User Tools

Site Tools


pt:sin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pt:sin [2016/01/01 22:48] (current)
Line 1: Line 1:
 +===== Sin =====
 +
 +==== Formato ====
 +
 +**sin** ( //​expression//​ )
 +
 +==== Descrição ====
 +
 +Calcula o seno de //​expression//​ (em radianos).
 +
 +==== Nota ====
 +
 +A função devolve um valor aproximado.
 +
 +==== See Also ====
 +
 +[[acos|Acos]],​ [[asin|Asin]],​ [[atan|Atan]],​ [[cos|Cos]],​ [[degrees|Degrees]],​ [[radians|Radians]],​ [[tan|Tan]]
 +
 +==== Exemplo ====
 +
 +<​code>​
 +clg
 +color black
 +# draw a line across the graphic output
 +line 0,​150,​300,​150
 +# where do we start
 +lastx = 0
 +lasty = sin(0) * 50 + 150
 +# now step across the line and draw
 +for x = 0 to 300 step 5
 +   angle = x / 300 * 2 * pi
 +   y = sin(angle) * 50 + 150
 +   line lastx, lasty, x, y
 +   lastx = x
 +   lasty = y
 +next x
 +</​code>​
 +Desenha:\\
 +{{en:​sin.jpg|Sine Curve}}
  
pt/sin.txt · Last modified: 2016/01/01 22:48 (external edit)