Maths Question.
Blitz3D Forums/Blitz3D Beginners Area/Maths Question.
| ||
Sorry I have not done any maths like this in at least 16 years so I am totaly lost on this. Given two points at different heights. How do you calculate the angle between them. So you could (for example) know what angle to rasie your camera to look at the higher point. Thanks Max |
| ||
Assuming the two points are entities in a 3d world then use deltapitch( ent1, ent2 ) .. this will return the pitch angle required for ent1 to point at ent2. |
| ||
*Pythagoras turns in his grave* :) |
| ||
if it's 2D you can use Atan2: angle=Atan2(x1-x2,y1-y2) |
| ||
The param order is y,x for atan2. i.e. ATan2(y#,x#) |
| ||
Thanks guys. Sorry for my poor maths in this area :( Max |
| ||
big - that's what I always re-discover by trial and error :P |
| ||
Me too, to be honest! :P |