Re: Distance between 2 points
- Posted by "Carl R. White" <C.R.White at SCM.BRAD.AC.UK> Sep 30, 1998
- 502 views
On Tue, 29 Sep 1998, PatRat wrote: > Hello, > Does any1 know how to calulate the distance and angle from > point A to point B given their coordinates. > Thanks At the risk of answering homework here :) opposite = b[Y] - a[Y] adjacent = b[X] - a[X] distance = sqrt(power(opposite,2)+power(adjacent,2)) angle = arctan(opposite/adjacent) -- Carl R White E-mail...: cyrek- at -bigfoot.com -- Remove the hyphens before mailing. Ta :) Url......: http://www.bigfoot.com/~cyrek/ "Ykk rnyllaqur rgiokc cea nyemdok ymc giququezka caysgr." - B.Q.Vgesa