Difference between revisions of "Trigonometry Conversion Operators"

From GiderosMobile
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 ===
 
 
<!-- 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>Available since</translate>:''' Gideros 2017.10<br/>
 
 
 
=== <translate>Description</translate> ===
 
 
Operators to convert from one type of measurement to another.
 
Operators to convert from one type of measurement to another.
  
'''^<''' deg &emsp; Convert 'deg' into radians.<br/>
+
'''^<''' deg &emsp; Convert 'deg' into radians<br/>
'''^>''' rad &emsp; Convert 'rad' into degrees.<br/>
+
'''^>''' rad &emsp; Convert 'rad' into degrees<br/>
  
=== <translate>Examples</translate> ===
+
=== Examples ===
'''Simple degree to radian (^<) examples:'''
+
'''Simple degree to radian (^<) examples'''
 
<source lang="lua">
 
<source lang="lua">
 
r=^<d -- faster than r=math.rad(d)
 
r=^<d -- faster than r=math.rad(d)
Line 21: Line 17:
 
</source>
 
</source>
  
'''Simple radian to degree (^>) examples:'''
+
'''Simple radian to degree (^>) examples'''
 
<source lang="lua">
 
<source lang="lua">
 
d=^>r -- faster than d=math.deg(r)
 
d=^>r -- faster than d=math.deg(r)
Line 29: Line 25:
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Events</translate> ===
+
=== Events ===
=== <translate>Constants</translate> ===
+
=== Constants ===
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 00:24, 30 November 2022

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

Methods

Events

Constants