Difference between revisions of "ATan2"
Jump to navigation
Jump to search
imported>DragoonWraith (rv) |
imported>QQuix m (Adjusting text) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
'''Syntax:''' | '''Syntax:''' | ||
atan2 [float1] [float2] | atan2 [float1] [float2] | ||
or | |||
datan2 [float1] [float2] | |||
Returns the angle of (float2;float1) vector | Returns the angle of (float2;float1) vector | ||
Line 15: | Line 17: | ||
*From v0005, all OBSE trigonometric functions take and return degrees. Versions of the functions which accept radians are still available by prefixing the function name with an r. (i.e. ratan2) | *From v0005, all OBSE trigonometric functions take and return degrees. Versions of the functions which accept radians are still available by prefixing the function name with an r. (i.e. ratan2) | ||
*This function can be used in a mathematical formula (c + atan2 a b), but a mathematical formula as the arguement for this function will not give correct result (the result of atan2 a (b + c) will be a+b+c). | *This function can be used in a mathematical formula (c + atan2 a b), but a mathematical formula as the arguement for this function will not give correct result (the result of atan2 a (b + c) will be a+b+c). | ||
*For a right triangle, the first float is the opposite side and the second float the adjacent side. | |||
==See Also== | ==See Also== | ||
Line 26: | Line 29: | ||
[[Category: Functions]] | [[Category: Functions]] | ||
[[Category: Functions (OBSE]] | [[Category: Functions (OBSE)]] | ||
[[Category: Math Functions]] | |||
[[Category: Math Functions (OBSE)]] | [[Category: Math Functions (OBSE)]] |
Latest revision as of 16:28, 30 April 2012
A command for Oblivion Script Extender
Syntax:
atan2 [float1] [float2]
or
datan2 [float1] [float2]
Returns the angle of (float2;float1) vector
Example[edit | edit source]
set theta to atan2 y x
Notes[edit | edit source]
- Returns a value from 0 to 180 or 0 to -180
- From v0005, all OBSE trigonometric functions take and return degrees. Versions of the functions which accept radians are still available by prefixing the function name with an r. (i.e. ratan2)
- This function can be used in a mathematical formula (c + atan2 a b), but a mathematical formula as the arguement for this function will not give correct result (the result of atan2 a (b + c) will be a+b+c).
- For a right triangle, the first float is the opposite side and the second float the adjacent side.