Difference between revisions of "Trigonometry Conversion Operators"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 15: Line 15:
 
radAngle=^<sprite:getRotation()
 
radAngle=^<sprite:getRotation()
 
pi=^<180 -- pi is 3.142 in radians or 180 in degrees
 
pi=^<180 -- pi is 3.142 in radians or 180 in degrees
</source>
+
</syntaxhighlight>
  
 
'''Simple radian to degree (^>) examples'''
 
'''Simple radian to degree (^>) examples'''
Line 21: Line 21:
 
d=^>r -- faster than d=math.deg(r)
 
d=^>r -- faster than d=math.deg(r)
 
sprite:setRotation(^>math.sin(0.5))
 
sprite:setRotation(^>math.sin(0.5))
</source>
+
</syntaxhighlight>
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 15: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))