关于算法 [英] regarding algorithim

查看:116
本文介绍了关于算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想找一个算法,它计算从给定点到线的最短垂直距离。


谢谢


Mohan

Hi

I want to find an algorithim , which calculates shortest perpendicular
distance from a given point to a line.

Thanks

Mohan

推荐答案

invincible写道:
invincible wrote:


我想找一个算法,它计算从给定点到线的最短垂直距离。
Hi

I want to find an algorithim , which calculates shortest perpendicular
distance from a given point to a line.




这显然不是*与C编程语言有关的问题,

所以如果*不是* comp.lang.c的问题

< ot>

为了让你开始,从(x0,y0)到线ax +的距离+ c = 0

是晶圆厂((a * x0 + b *) Y0 + C)/ SQRT(A * A + b * b))。这是基础数学。如果你不能为你自己得到这个,那就放弃你的编程课程,然后把你应该学到的数学作为



< ; / ot>



This is obviously *not* a problem related to the C programming language,
and so if *not* a question for comp.lang.c
<ot>
Just to get you started, the distance from (x0,y0) to the line ax+by+c=0
is fabs((a*x0+b*y0+c)/sqrt(a*a+b*b)). This is elementary math. If you
can''t derive that for yourself, drop your programming course and take
the math you should have learned already.
</ot>


2005年4月4日星期一12:20:15 +0530,无敌

< mo ** ********@in.bosch.com>在comp.lang.c中写道:
On Mon, 4 Apr 2005 12:20:15 +0530, "invincible"
<mo**********@in.bosch.com> wrote in comp.lang.c:


我想找一个算法,它计算从给定点到最短的垂直距离一行。

谢谢

Mohan
Hi

I want to find an algorithim , which calculates shortest perpendicular
distance from a given point to a line.

Thanks

Mohan




你很幸运。


只需找到从给定点到直线的任意垂直距离。这是
将是最短的,因为只有一个。


-

Jack Klein

主页: http://JK-Technology.Com

常见问题解答

comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html

comp.lang.c ++ http://www.parashift.com/c++-faq-lite/

alt.comp.lang.learn.c-c ++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html



You''re in luck.

Just find ANY perpendicular distance from a given point to a line. It
will be the shortest, since there is only one.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html


文章< 3i ******************************** @ 4ax.com>,

Jack Klein< ja ******* @ spamcop.net>写道:
In article <3i********************************@4ax.com>,
Jack Klein <ja*******@spamcop.net> wrote:
只需找到从给定点到直线的任何垂直距离。它将是最短的,因为只有一个。
Just find ANY perpendicular distance from a given point to a line. It
will be the shortest, since there is only one.




a)这取决于你在哪个几何体上操作;

b)即使在您可能正在考虑的几何体内,也有...... b $ b通常是两个答案......其中一个是无限的,

c)已公布的等式变得不稳定了

a ** 2 + b ** 2接近0.

-

这是一个黄金时代,一个时间高冒险,丰富的生活和

艰难的死...但没有人这么认为。 - Alfred Bester,TSMD



a) That depends on which geometry you are operating in;
b) Even within the geometry you were probably thinking of, there
are usually -two- answers... one of which is infinite,
c) The equation that was posted goes unstable as
a**2+b**2 approaches 0.
--
"This was a Golden Age, a time of high adventure, rich living and
hard dying... but nobody thought so." -- Alfred Bester, TSMD


这篇关于关于算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆