Tan (number)  

Definition:

Returns the tangent of an angle.

Parameter Description:


number=float or integer representing a value in degrees

Command Description:

Tan takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.

This is useful for artillery sort of games where your bullets will fire from a barrel at a certain angle. You can use the Tan value in your power/angle formula to help determine the trajectory of the shot.

Example:

; tan example

angle1=25
angle2=45

print "The ratio of angle 1 is: " + tan(angle1)
print "The ratio of angle 2 is: " + tan(angle2)
waitkey()

Index