Difference between revisions of "Trigonometry Functions"
Jump to navigation
Jump to search
m
→Taylor Series Variant 2: tweaked
imported>Bifmadeinsabbioni |
imported>JOG m (→Taylor Series Variant 2: tweaked) |
||
Line 105: | Line 105: | ||
Begin {appropriate blocktype} | Begin {appropriate blocktype} | ||
set angle to player.getangle z | set angle to player.getangle z | ||
set angle to angle + 360 * (angle < -180) ; Normalize to +/- 180° | |||
set angle to angle - 360 * (angle > 180) | |||
set t1 to angle / 57.29577951 ; precalculate powers of "angle" | set t1 to angle / 57.29577951 ; precalculate powers of "angle" | ||
set t2 to t1*t1 | set t2 to t1*t1 | ||
set t5 to t2*t2*t1 | set t5 to t2*t2*t1 | ||
set t6 to t5*t1 | set t6 to t5*t1 | ||
Line 121: | Line 116: | ||
set tana to sina/cosa | set tana to sina/cosa | ||
end | end | ||
== Taylor Series Variant 3 == | == Taylor Series Variant 3 == |