Using the sqrt(r^2-x^2) formula I get the same results as with the [sin], [cos]. Maybe I'm just implementing it wrong, but I can't figure out why it's not plotting the correct y values...
Here's the patch I sent before with my implementation of the sqrt(r^2 - x^2)
On Sun, Apr 10, 2011 at 8:52 AM, Mathieu Bouchard matju@artengine.cawrote:
On Sun, 10 Apr 2011, Tyler Leavitt wrote:
I've not had any real success using the formulas with [sin] and [cos]...
I don't know why, but I had assumed that you wanted to plot something "parametrically", such as a path drawn from x(t) and y(t) functions, instead of a y(x) function. I was reading too fast.
For a y(x) function, sqrt(r*r-x*x) is the formula to use.
That is related to the fact that sqrt(1-x*x) = sin(acos(x)) = cos(asin(x)) where asin is anti-sin and acos is anti-cos.
It's also related to Pythagoras' theorem x*x + y*y = r*r which is also sin(t)*sin(t) + cos(t)*cos(t) = 1.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC