Difference between revisions of "Trigonometry Conversion Operators"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' android, ios, mac, pc<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/>
 
'''Available since:''' Gideros 2017.10<br/>
 
'''Available since:''' Gideros 2017.10<br/>
 +
 
=== Description ===
 
=== Description ===
<translate><br />
+
Operators to convert from one type of measurement to another.
Operators to convert from one type of measurement to another.<br /><br />
+
 
 +
'''^<''' deg &emsp; Convert 'deg' into radians<br/>
 +
'''^>''' rad &emsp; Convert 'rad' into degrees<br/>
  
<b> ^&lt; </b>deg &emsp; Convert 'deg' into radians.<br />
 
<b> ^&gt; </b>rad &emsp; Convert 'rad' into degrees.<br /></translate>
 
 
=== Examples ===
 
=== Examples ===
'''Simple ^< examples'''<br/>
+
'''Simple degree to radian (^<) examples'''
<source lang="lua">  
+
<syntaxhighlight lang="lua">
r=^&lt;d -- faster than r=math.rad(d)
+
r=^<d -- faster than r=math.rad(d)
radAngle=^&lt;sprite:getRotation()
+
radAngle=^<sprite:getRotation()
pi=^&lt;180 -- pi is 3.142 in radians or 180 in degrees</source>
+
pi=^<180 -- pi is 3.142 in radians or 180 in degrees
'''Simple ^> examples'''<br/>
+
</syntaxhighlight>
<source lang="lua">  
+
 
d=^&gt;r -- faster than d=math.deg(r)
+
'''Simple radian to degree (^>) examples'''
sprite:setRotation(^&gt;math.sin(0.5))</source>
+
<syntaxhighlight lang="lua">
{|-
+
d=^>r -- faster than d=math.deg(r)
| style="width: 50%;"|
+
sprite:setRotation(^>math.sin(0.5))
=== Methods ===
+
</syntaxhighlight>
| style="width: 50%;"|
+
 
=== Events ===
+
{{GIDEROS IMPORTANT LINKS}}
=== Constants ===
 
|}
 

Latest revision as of 14:33, 13 July 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
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))