Trigonometry Conversion Operators: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 22: Line 22:
sprite:setRotation(^>math.sin(0.5))
sprite:setRotation(^>math.sin(0.5))
</source>
</source>
{|-
| style="width: 50%; vertical-align:top;"|
=== Methods ===
| style="width: 50%; vertical-align:top;"|
=== Events ===
=== Constants ===
|}


{{GIDEROS IMPORTANT LINKS}}
{{GIDEROS IMPORTANT LINKS}}

Revision as of 23:33, 29 November 2022

Supported platforms:
Available since: Gideros 2017.10

Description

Operators to convert from one type of measurement to another.

^< deg   Convert 'deg' into radians
^> rad   Convert 'rad' into degrees

Examples

Simple degree to radian (^<) examples

r=^<d -- faster than r=math.rad(d)
radAngle=^<sprite:getRotation()
pi=^<180 -- pi is 3.142 in radians or 180 in degrees

Simple radian to degree (^>) examples

d=^>r -- faster than d=math.deg(r)
sprite:setRotation(^>math.sin(0.5))