Trigonometry Conversion Operators: Difference between revisions
From GiderosMobile
→Description: fixed > and < not showing by changing the source="lua" to <code> + small additions to text. |
|||
| Line 20: | Line 20: | ||
r=^<d -- faster than r=math.rad(d)<br/> | r=^<d -- faster than r=math.rad(d)<br/> | ||
radAngle=^<sprite:getRotation()<br/> | radAngle=^<sprite:getRotation()<br/> | ||
pi=^<180 -- pi is 3.142 in radians or 180 in degrees | pi=^<180 -- pi is 3.142 in radians or 180 in degrees | ||
</code><br/> | </code><br/> | ||
| Line 31: | Line 31: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Revision as of 19:16, 6 December 2019
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))
Methods |
EventsConstants |