Difference between revisions of "Trigonometry Conversion Operators"
From GiderosMobile
| (12 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| − | '''Supported platforms:''' android | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform linux.png]]<br/> |
'''Available since:''' Gideros 2017.10<br/> | '''Available since:''' Gideros 2017.10<br/> | ||
| − | |||
| − | |||
| − | |||
| − | + | === Description === | |
| − | + | Operators to convert from one type of measurement to another. | |
| − | === | + | |
| − | '''Simple ^< examples''' | + | '''^<''' deg   Convert 'deg' into radians<br/> |
| − | < | + | '''^>''' rad   Convert 'rad' into degrees<br/> |
| − | r=^ | + | |
| − | radAngle=^ | + | === Examples === |
| − | pi=^ | + | '''Simple degree to radian (^<) examples''' |
| − | '''Simple ^> examples''' | + | <syntaxhighlight lang="lua"> |
| − | < | + | r=^<d -- faster than r=math.rad(d) |
| − | d=^ | + | radAngle=^<sprite:getRotation() |
| − | sprite:setRotation(^ | + | pi=^<180 -- pi is 3.142 in radians or 180 in degrees |
| − | + | </syntaxhighlight> | |
| − | + | ||
| − | + | '''Simple radian to degree (^>) examples''' | |
| − | + | <syntaxhighlight lang="lua"> | |
| − | + | d=^>r -- faster than d=math.deg(r) | |
| − | + | sprite:setRotation(^>math.sin(0.5)) | |
| − | + | </syntaxhighlight> | |
| + | |||
| + | {{GIDEROS IMPORTANT LINKS}} | ||
Latest revision as of 23:49, 13 January 2025
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))