Difference between revisions of "Trigonometry Conversion Operators"

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

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))