Find angle between 2 points using 2d coordinates.

G

Guest

Find angle between 2 points using 2d coordinates.

I am trying to write a tool to find angle between 2 coordinates in 2d space.

I know the distance of adjacent side and hypotenuse.

Cos(angle) = adjacent side / hypotenuse

Angle = (adjacent side / hypotenuse) inverse of Cos

I exactly don’t know where to find and use the inverse function in vb.net

Your help much appreciated..

Thx
JK
 
G

Guest

thx for respoding fast but i get a wrong Answer.

say for example lets take a erual triagnel of sides each 6 units. so
Cos(xxx) = Adj / Hyp
ie

Cos(Angle) = 3 / 6
Cos(Angle)= 0.5
(Angle) = o.5 invers of Cos
(Angle) = 60Deg

but i use the as per your thoughs

if i use

System.Math.Acos(xxx) ie System.Math.Acos(0/5) i get 1.047198

i am in chaos...help me..

-JK
 
M

Marc Gravell

60 degrees = 1.04719755 [etc] radians

Same answer, but a lot of math on trigonometry is expressed in radians;

to get back to 60, divide by Pi and multiply by 180 (or look for an existing
conversion function)

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top