The 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)

float fValue 
The angle (measured in degrees) to take the tangent of.

See alsoEdit

  • atan() — arctangent command
  • cos() — cosine command
  • sin() — sine command

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.