Difference between revisions of "ESM Math Library"
Jump to navigation
Jump to search
no edit summary
imported>JustTim |
imported>JustTim |
||
|
=== Welcome ===
If you've written such a function and you think it might be helpful to others, don't hesitate to contribute to this repository.
=== First Steps ===
To get this up and running follow there simple setup steps:
* Open any Plugin you wish or create a new one with the Construction Set
* Create a new Quest called "f" (yes, just the letter "f", nothing more)
* Activate the Checkbox "Allow repeated stages". (This is VERY important!!)
* Create a new Quest Script and copy the whole content of the "Quest Script" section from this article into this script. Don't forget to attach it to your f-Quest!
* Create a new stage in this quest for each function you want to use from this repository and copy all code from it's section in this article to the related Result Script textbox. Make sure to select the right stage number for the function.
* That's it! You should be able to use them now!
=== Quest Script ===
End</pre>
===
Based on [[Square_Root|Square Root]] Article
<pre>;FUNCTION float sqrt(float input)
endif</pre>
===
<pre>;FUNCTION float Hypotenuse(float CathetusA, float CathetusB)
;fout is already the result</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float,float,float SinCosTan(float Angle)
set f.fout3 to (f.sin/f.cos) ;tan</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float,float,float SinCosTan(float Angle)
set f.fout3 to f.sin/f.cos ;tan</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arcsine(float sin)
set f.fout to f.rad*(1.5707963-f.n*(1.5707288-0.2121144*f.sin+0.0742610*f.sin*f.sin-0.0187293*f.sin*f.sin*f.sin))</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arcsine(float sin)
set f.fout to (f.fin1 + (1/2)*(t3/3) + (3/8)*(t5/5) + (15/48)*(t7/7) )</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arccosine(float cos)
set f.fout to ((f.pi / 2) - f.fout)</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arccosine(float cos)
set f.fout to ((f.pi / 2) - f.fout)</pre>
===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arctan(float tan)
set f.fout to (f.fin1 - (f.t3/3) + (f.t5/5) - (f.t7/7))</pre>
===
<pre>;FUNCTION float getAngle(float x, float y)
| |||