Difference between revisions of "ESM Math Library"

Jump to navigation Jump to search
775 bytes added ,  12:53, 9 May 2006
no edit summary
imported>JustTim
 
imported>JustTim
=== Welcome ===
Welcome to the Stage Function Repository! The goal of the Repository is, to create a huge database of available functions all using the method descripted in the article [[Simulating_new_functions|Simulating new functions]].
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>
 
=== Stage5Stage 5: Square Root ===
Based on [[Square_Root|Square Root]] Article
<pre>;FUNCTION float sqrt(float input)
endif</pre>
 
=== Stage10Stage 10: Hypotenuse ===
<pre>;FUNCTION float Hypotenuse(float CathetusA, float CathetusB)
 
;fout is already the result</pre>
 
=== Stage15Stage 15: Sin Cos Tan ===
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>
 
=== Stage16Stage 16: Sin Cos Tan 2 ===
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>
 
=== Stage20Stage 20: Arcsine ===
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>
 
=== Stage21Stage 21: Arcsine 2 ===
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>
 
=== Stage22Stage 22: Aroccosine ===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arccosine(float cos)
set f.fout to ((f.pi / 2) - f.fout)</pre>
 
=== Stage23Stage 23: Arccosine 2 ===
Based on [[Trigonometry_Functions|Trigonometry Functions]] Article
<pre>;FUNCTION float Arccosine(float cos)
set f.fout to ((f.pi / 2) - f.fout)</pre>
 
=== Stage24Stage 24: Arctan ===
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>
 
=== Stage30Stage 30: getAngle ===
<pre>;FUNCTION float getAngle(float x, float y)
 
Anonymous user

Navigation menu