tan() NWScript command returns the tangent of a float. That is, this command returns
y/x for the endpoint
(x,y) (in the Cartesian plane) of the line segment, originating at
(0,0), of length 1 that forms an angle with the positive
x-axis of size equal to the provided value, measured in degrees. (Thus, the returned value can be any real number.) For positive angles less than 90 degrees, this is equivalent to taking the ratio of the lengths of two sides of a right triangle with an angle of the indicated measure — specifically, the length of the leg opposite the angle divided by the length of the leg adjacent to the angle.
When calculating the tangent causes a division by zero (e.g. the tangent of 90 degrees), this function returns a very large number, presumably as a result of whatever approximation is being used behind the scenes.
float tan (float fValue
- The angle (measured in degrees) to take the tangent of.
atan()— arctangent command