trig

How can I find the arctan of a right triangle using only the hypotenuse?

Okay, so I need to make C go the shortest path from A to B. A to B is the hypotenuse of my right triangle, and I need to give C the arctan of said triangle. How do I do this, and does the formula have a name? ...

AS3 (or any language) trig library for triangles?

Does anyone know of a library for easily dropping in parameters of angles and lengths of sides, and letting it automagically extrapolate the non-given angles and lengths using trig? Even if it had lame performance, it would be very useful for prototyping, and performance could be optimized (even supplying table lookup and the sort). If...

Rotate normal vector onto axis plane

I have a set of data points in 3D space which apparently all fall onto a specific plane. I use PCA to compute the plane parameters. The 3rd component of PCA gives me the normal vector of the plane (weakest component). What I want to do next is to transform all the points onto said plane and look at it in 2D. My idea was to do the foll...

Polar and Cartesian calculations not completely working?

double testx, testy, testdeg, testrad, endx, endy; testx = 1; testy = 1; testdeg = atan2( testx, testy) / Math::PI* 180; testrad = sqrt(pow(testx,2) + pow(testy,2)); endx = testrad * cos(testdeg); endy = testrad * sin(testdeg); All parts of this seem to equate properly, except endx and endy should = testx and testy they do when cal...

sine wave glissando from one pitch to another in Numpy

Hello! I have been working on a program where I need to slowly and smoothly change the pitch of a sine wave from one pitch to another. I am able to get an array of the frequency the pitch should be at any given moment (for instance, [440, 526.5, 634.2 794.8, 880], though much, much longer) but it seems I am unable to actually apply tha...

How do I implement multiple sources of gravity, specifically the trig required. (C#) VS 2010

Hi guys. I am designing a small game wherein objects are attracted by multiple objects at once. What I am doing is plotting the course that the shots of these objects will take. To calculate the pull of the planets, I am using this formula: gravityStr/distToTarg^2 (pseudo code). Where my problem lies is in calculating the direction (an...