Files
BlitzNext/_release/help/commands/2d_commands/Tan.htm
T
2014-02-26 16:08:39 +13:00

12 lines
1.6 KiB
HTML

<html><head><title>Command: Tan </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Tan (number)&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the tangent of an angle.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>number=float or integer representing a value in degrees</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>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.<br>
<br>
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.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; tan example<br>
<br>
angle1=25<br>
angle2=45<br>
<br>
print "The ratio of angle 1 is: " + tan(angle1)<br>
print "The ratio of angle 2 is: " + tan(angle2)<br>
waitkey()<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>