Calculation angle between point

Hello people,

i would like to calculate the angle between two point i pick.
The helpfile says i cal calculate the angle by using the formula :
theAngle = acos(dot (normalize p1) (normalize p2))

Well thats is okey if you first pick 0,0,0 then a other point. the angle is okey.
But if you start picking the first point somewhere else it's not working.
so this must be realated to local and world space things... ??

Any1 who can point me in the right direction ?

cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Aline3D's picture

Crazyoshachou is right,

Crazyoshachou is right,

Only is possible get a angle using 3 points (in math theory).

But in this case, the script works because he want get a angle between 2 points using the world coordsys.

Then, the thirty point is the prolongation (P) of 2 points (A and B).

Thank you for your correction :))

 

AlineLima
Script Developer - SeagullsFly
www.seagullsfly.com
Brasil

crazyosachou's picture

hi, well, i try u mersure

hi,
well, i try u mersure thing, and there's no sens to the angle wich it calculate, as i told u, there's only 1 angle between 2 points, wich is the zero "0" angle, wich mean that we have 3 points, 2 of them are the same point (in same position).

well, if u think it work, it's fine thant for you.
Good luck.

learn more,learn as fast as u can, coz u can be not able to learn more tommorow!!

pixelstudio's picture

hmm i think it worked for

hmm i think it worked for me, you can download the script from my weblog to see. it's called measure thingie's (realy orginal name huh :) )

http://www.pixelstudio.nl/?page_id=85

crazyosachou's picture

hi, i don't agree guys,

hi,
i don't agree guys, there's a little problem with u'r reflexion, when we talk about angle , we need 3 point de get an Angle, the angle between 2 point is always equal 0.
So, u'r function calculate the angle between u'r 2 points and the 3rd one wich is the point[0,0,0].
-------------------------------------------------
To calculate that angle, u need to ask Mathematiques person, i can past time to find it 4 u, but it'll take me time, u can get it quickly by asking a Teacher of mathematique in university, and reply it in max.
-------------------------------------------------
if u'r good in math, the idea is :
we have 3 point A,B,C : to calculate the angle "ANG" between A & B at the point C
1st- Calculate the position of the point P wich is the projection of point B on the line (AC).

2nd- Now, the angle ANG between A & B at the point C is the same of the angle between A & P at the point C, the Difference is : The triangle APC have a perpendicular angle at the point P not the triangle ABC, so it's easy to calculate the angle because :
Cos(ANG) = CP/CB --(distances)
Sin(ANG) = BP/CB
we know the poin3 of all points, wich mean we can calculate distances between them.
then your angle:
ANG=acos(CP/CB) and ANG=asin(BP/CB)
----------------------------------------------------
i gived u a small drawing to understand. Good luck

AttachmentSize
angle.jpg 13.32 KB

learn more,learn as fast as u can, coz u can be not able to learn more tommorow!!

Aline3D's picture

in this case use: p1 =

in this case use:

p1 = [0,0,0]

p2 = ($Point02.pos - $Point01.pos)

AlineLima
Script Developer - SeagullsFly
www.seagullsfly.com
Brasil

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.