GateKeeper
09-22-2002, 01:24 PM
How would I go about reversing math functions such as Sin, Cos and Tan in the way a calculator does. Instead of knowing the angle I am working with, I know the lengths of my Hypotenus and such. For instance;
I have a triangle that has a hypotenuse of 29 and an opposite side of 15. I need to know what the angle is in degrees. I know on a calculator I can hit the good old "INV" key after doing the basic division. Is there a similar feature in JS or am I going to be stuck with forcing everything into a right triangle format, comparing lengths and then using the A^2 + B^2 = C^2 formulas to get the desired information.
My basic goal here is to build off of my previous scripts that plotted a line from point A to point B across a trek of land. If that line falls across an area that is unpassable (like a really huge mountain or canyon) then the script will pause at that point and begin adjusting the course plotted in a circular direction until it finds an area that is passable again.
If that sounds confusing, just let me know, and when I wake up, I will try describing that again after some much needed sleep.
GK
I have a triangle that has a hypotenuse of 29 and an opposite side of 15. I need to know what the angle is in degrees. I know on a calculator I can hit the good old "INV" key after doing the basic division. Is there a similar feature in JS or am I going to be stuck with forcing everything into a right triangle format, comparing lengths and then using the A^2 + B^2 = C^2 formulas to get the desired information.
My basic goal here is to build off of my previous scripts that plotted a line from point A to point B across a trek of land. If that line falls across an area that is unpassable (like a really huge mountain or canyon) then the script will pause at that point and begin adjusting the course plotted in a circular direction until it finds an area that is passable again.
If that sounds confusing, just let me know, and when I wake up, I will try describing that again after some much needed sleep.
GK