This shows you the differences between two versions of the page.
en:tan [2016/08/12 12:15] admin |
en:tan [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Tan (Function) ===== | ||
- | ==== Format ==== | ||
- | **tan** ( [[numericexpressions|numeric_expression]] ) | ||
- | returns [[floatexpressions|float_expression]] | ||
- | |||
- | ==== Description ==== | ||
- | Computes the tangent of angle in radians. | ||
- | |||
- | ==== Note ==== | ||
- | The tan function does not produce an exact result. | ||
- | |||
- | ==== Example ==== | ||
- | < | ||
- | clg | ||
- | color black | ||
- | # draw a line across the graphic output | ||
- | line 0, | ||
- | # where do we start | ||
- | lastx = 0 | ||
- | lasty = tan(0) * 50 + 150 | ||
- | # now step across the line and draw | ||
- | for x = 0 to 300 step 5 | ||
- | angle = x / 300 * 2 * pi | ||
- | y = tan(angle) * 50 + 150 | ||
- | line lastx, lasty, x, y | ||
- | lastx = x | ||
- | lasty = y | ||
- | next x | ||
- | </ | ||
- | Draws | ||
- | {{tan.jpg}} | ||
- | |||
- | ==== See Also ==== | ||
- | {{page> |