Add cartesian to polar conversion functions

This commit is contained in:
pablotato 2017-10-13 01:15:45 +02:00 committed by Rémi Verschelde
parent fb801d4964
commit 054a2ac579
7 changed files with 132 additions and 22 deletions

View file

@ -138,6 +138,17 @@
Decodes a byte array back to a value.
</description>
</method>
<method name="cartesian2polar">
<return type="Vector2">
</return>
<argument index="0" name="x" type="float">
</argument>
<argument index="1" name="y" type="float">
</argument>
<description>
Converts a 2D point expressed in the cartesian coordinate system (x and y axis) to the polar coordinate system (a distance from the origin and an angle).
</description>
</method>
<method name="ceil">
<return type="float">
</return>
@ -604,6 +615,17 @@
[/codeblock]
</description>
</method>
<method name="polar2cartesian">
<return type="Vector2">
</return>
<argument index="0" name="r" type="float">
</argument>
<argument index="1" name="th" type="float">
</argument>
<description>
Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (x and y axis).
</description>
</method>
<method name="pow">
<return type="float">
</return>