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><br />
<translate>
Operators to convert from one type of measurement to another.<br /><br />
Operators to convert from one type of measurement to another.<br />


<b> ^&lt; </b>deg &emsp; Convert 'deg' into radians.<br />
<b> ^&lt; </b>deg &emsp; Convert 'deg' into radians.<br />
<b> ^&gt; </b>rad &emsp; Convert 'rad' into degrees.<br /></translate>
<b> ^&gt; </b>rad &emsp; Convert 'rad' into degrees.<br />
</translate>
 
=== <translate>Examples</translate> ===
=== <translate>Examples</translate> ===
'''Simple ^< examples'''<br/>
'''Simple degree to radian (^<) examples:'''<br/>
<source lang="lua">  
<code>
r=^&lt;d -- faster than r=math.rad(d)
r=^&lt;d -- faster than r=math.rad(d)<br/>
radAngle=^&lt;sprite:getRotation()
radAngle=^&lt;sprite:getRotation()<br/>
pi=^&lt;180 -- pi is 3.142 in radians or 180 in degrees</source>
pi=^&lt;180 -- pi is 3.142 in radians or 180 in degrees<br/>
'''Simple ^> examples'''<br/>
</code><br/>
<source lang="lua">  
 
d=^&gt;r -- faster than d=math.deg(r)
'''Simple radian to degree (^>) examples:'''<br/>
sprite:setRotation(^&gt;math.sin(0.5))</source>
<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;"|
| 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

Events

Constants