English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I know of the ellipse equation, (x-h)^2/a+(y-k)^2/b=1. I have been unable to isolate either x or y, which if anyone can help me with this than, I can write my own program, and I will be happy. Or.... If anyone knows of an algorithm or code that can draw unfilled ellipses, written in C, VB, or ASM, I would also been very happy. Either way the problem is solved. It would be a very big bonus if it were written in ASM, seeing that, that is what I'm programming in. LAST NOTE: The procedure should only require the middle x,y coordinates of the ellipse and the width and height of the ellipse. Thank you to all who reply.

2007-07-09 08:43:43 · 4 answers · asked by Bridgeofstraws 2 in Science & Mathematics Mathematics

4 answers

Good question.

First, isolate the y:
(x-h)²/a² + (y-k)²/b² = 1
Subtract first ratio from both sides: (y-k)²/b² = 1-(x-h)²/a²
Multiply by b² : (y-k)² = b²(1-(x-h)²/a²)
Take square root of both sides: y-k =±√(b²(1-(x-h)²/a²))
Add k to both sides: y = k ± √(b²(1-(x-h)²/a²))

Notice the "±", which basically makes this two equations; put together, the graph of an ellipse is *not* a function (use vertical line test). So, two passes must be done to graph the whole ellipse:
y = k + √(b²(1-(x-h)²/a²))
y = k - √(b²(1-(x-h)²/a²))

2007-07-09 08:53:41 · answer #1 · answered by Tony The Dad 3 · 0 0

(x-h)^2/a^2 +(y-k)^2/ b^2 =1 is an ellipse with center at (h,k), major axis parallel to x-axis, width = 2a, and height = 2b.

(y-k)^2/a^2 + (x-h)^2/b^2 =1 is an ellipse with center at (h,k), major axis parallel to y-axis, width = 2a, and height = 2b.

c = sqrt(a^2+b^2) where (-c+h,k) and (c+h,,k) are the foci.

You can use the equation y= k+(1/a)sqrt(a^b^2 -(x-h)^)) to get half of the ellipse and y= k-(1/a)sqrt(a^b^2 -(x-h)^)) to get other half on a calculator. Why not use same method as TI 83+ or above uses?

The sum of the distances from any point P(x,y) on the ellipse to the foci = 2a.

2007-07-09 09:38:48 · answer #2 · answered by ironduke8159 7 · 0 0

I have an E-Book on Graphics which has certain basic algorithms (C versions) for various conics. It has an algorithm for ellipse which takes the midpoint and the two radii as parameters. I'll mail the book if required.

2007-07-09 09:03:04 · answer #3 · answered by aRe_yeS 2 · 0 0

Maybe write that in the parametric form...
(x-h)²/a² + (y-k)²/b² = 1

is the same as:
x = h + a cos(t)
y = k + b sin(t)

[Note since cos²(t) + sin²(t) = 1]

d:

2007-07-09 08:50:11 · answer #4 · answered by Alam Ko Iyan 7 · 0 1

fedest.com, questions and answers