- Joined
- Oct 12, 2008
- Messages
- 1,570
Hello people,,
I have had a few questions for a long time, and i have tried to find the answer, but no succes, so i am asking you guys here,,
If i want the angle between 2 point, i need a function,,
I checked the AngleBetweenPoints() function, which just used the Atan2() function,,
But what does Atan2 do? Ya, it calculates angle between 2 points, but how?
I though Atan was from ArcTangent, but why do we have Atan() and Atan2() then?
Then i heard it had something to do with polar coordinates, which involve (r,θ) (r = distance, θ = angle)
So i thought maybe Atan() calculates the 'r' (distance) and Atan2() the 'θ' (angle),, but then i still dont know why they called it Atan, if it calculates the distance, because the distance could be easily calculated with Pytagoras' function,,
So: What ar Atan() and Atan2() for,,
Also, if i want the angle between 2 point, cant i just use this:
as well as:
Arent these two doing the same as Atan2() ??
(I made them out of the calculation
Someone please help!
-Yixx,,-
I have had a few questions for a long time, and i have tried to find the answer, but no succes, so i am asking you guys here,,
If i want the angle between 2 point, i need a function,,
I checked the AngleBetweenPoints() function, which just used the Atan2() function,,
But what does Atan2 do? Ya, it calculates angle between 2 points, but how?
I though Atan was from ArcTangent, but why do we have Atan() and Atan2() then?
Then i heard it had something to do with polar coordinates, which involve (r,θ) (r = distance, θ = angle)
So i thought maybe Atan() calculates the 'r' (distance) and Atan2() the 'θ' (angle),, but then i still dont know why they called it Atan, if it calculates the distance, because the distance could be easily calculated with Pytagoras' function,,
So: What ar Atan() and Atan2() for,,
Also, if i want the angle between 2 point, cant i just use this:
set Angle = Acos((GetUnitX(Caster) - GetUnitX(Target))/Distance) * bj_RADTODEG
as well as:
set Angle = Asin((GetUnitY(Caster) - GetUnitY(Target))/Distance) * bj_RADTODEG
Arent these two doing the same as Atan2() ??
(I made them out of the calculation
NewX = X + Dist * Cos(a)
and NewY = Y + Dist * Sin(a)
)Someone please help!
-Yixx,,-