Trigonometry Conversion Operators: Difference between revisions
From GiderosMobile
No edit summary |
→Description: fixed > and < not showing by changing the source="lua" to <code> + small additions to text. |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<languages /> | <languages /> | ||
<!-- GIDEROSOBJ:Trigonometry Conversion Operators --> | <!-- GIDEROSOBJ:Trigonometry Conversion Operators --> | ||
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/> | ||
'''<translate>Available since</translate>:''' Gideros 2017.10<br/> | '''<translate>Available since</translate>:''' Gideros 2017.10<br/> | ||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
<translate | <translate> | ||
Operators to convert from one type of measurement to another. | Operators to convert from one type of measurement to another.<br /> | ||
<b> ^< </b>deg   Convert 'deg' into radians.<br /> | <b> ^< </b>deg   Convert 'deg' into radians.<br /> | ||
<b> ^> </b>rad   Convert 'rad' into degrees.<br /></translate> | <b> ^> </b>rad   Convert 'rad' into degrees.<br /> | ||
</translate> | |||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
'''Simple ^< examples'''<br/> | '''Simple degree to radian (^<) examples:'''<br/> | ||
< | <code> | ||
r=^<d -- faster than r=math.rad(d) | r=^<d -- faster than r=math.rad(d)<br/> | ||
radAngle=^<sprite:getRotation() | 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<br/> | ||
'''Simple ^> examples'''<br/> | </code><br/> | ||
< | |||
d=^>r -- faster than d=math.deg(r) | '''Simple radian to degree (^>) examples:'''<br/> | ||
sprite:setRotation(^>math.sin(0.5))</ | <code> | ||
d=^>r -- faster than d=math.deg(r)<br/> | |||
sprite:setRotation(^>math.sin(0.5)) | |||
</code><br/> | |||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Revision as of 05:13, 24 May 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 |