FUNCTION 2ANGLE(UN,TWO,TROI)
xa=object position x(UN)
ya=object position y(UN)
za=object position z(UN)
xb=object position x(TWO)
yb=object position y(TWO)
zb=object position z(TWO)
xc=object position x(TROI)
yc=object position y(TROI)
zc=object position z(TROI)
ux=xb-xa
uy=yb-ya
vx=xc-xa
vy=yc-ya
uvx=ux*vx
uvy=uy*vy
uv=uvx+uvy
Aab#=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)+(za-zb)*(za-zb)
Arab#=sqrt(ab#)
Bab#=(xb-xc)*(xb-xc)+(yb-yc)*(yb-yc)+(zb-zc)*(zb-zc)
Brab#=sqrt(ab#)
alfc=uv/1+(Arab#*Brab#)
alf=WRAPVALUE(acos(alfc))
endfunction alf
I AM trying to calculate the angle formed by three objects from the two vectors formed what is going wrong or can anyone give me an easier angle calculator(from coordinates or vectors)
ARM YOURSELF WITH KNOLEGE