Is it always possible to draw such an ellipse? (x-c_x)^2/a^3+(y-c_y)^2/b^2=1

Sydney Stein

Sydney Stein

Answered question

2022-08-11

Is it always possible to draw an ellipse given any two points and the center?
I have 2 points and I want to draw an ellipse that passes through those points.
I also have the center of the ellipse.
My question is: is it always possible to draw such an ellipse?
( x c x ) 2 a 2 + ( y c y ) 2 b 2 = 1
When trying to automatically render ellipses for information visualization, I tried calculating the radiuses a and b by solving the two-equation system. However, sometimes a 2 or b 2 would be negative and, therefore, a or b would return me NaN.
Edit: A test case where this is failing is with:
P 1 = ( 610 , 320 )
P 2 = ( 596 , 887 )
C = ( 289 , 648 )

Answer & Explanation

peculiopy

peculiopy

Beginner2022-08-12Added 8 answers

Step 1
Let's translate the coordinates so that the centre is at the origin. The two given points are then Q 1 = P 1 C = ( 321 , 328 ) and Q 1 = P 2 C = ( 307 , 239 )
Since the centred ellipse will be symmetric w.r.t. the axes, we can ignore the minus sign and use Q 1 = ( 321 , 328 ) instead, as that will also need to be on the ellipse. The two points are now both in the first quadrant.
Step 2
If you connect any two points in the first quadrant of an origin-centred axis-aligned ellipse, you will get a line with a negative slope. Or put another way, one of the points has the largest x-coordinate, and the other then must have the largest y-coordinate. Conversely, if you have any two points with positive coordinates, one with a largest x-coordinate and the other with the largest y-coordinate, then there is an origin-centred axis-aligned ellipse that goes through them.
This is not the case here with the two points (321,328) and (307,239). The first point has both coordinates larger than the other. So no origin-centred axis-aligned ellipse is possible through those points.
allucinemsj

allucinemsj

Beginner2022-08-13Added 5 answers

Step 1
b 2 ( x 1 c ) 2 + a 2 ( y 1 d ) 2 = ( a b ) 2
b 2 ( x 2 c ) 2 + a 2 ( y 2 d ) 2 = ( a b ) 2
The difference b 2 ( x 1 x 2 ) ( x 1 + x 2 2 c ) + a 2 ( y 1 y 2 ) ( y 1 + y 2 2 d ) = 0
note that x 1 , x 2 , y 1 , y 2 , c , d are given so we find a relation between a 2 , b 2 we use that in the first or second equation to find the a,b values we take positive values. If a 2 , b 2 are negative then there is no solution!
Step 2
Let translate the ellipse by make the center (0,0) in your example C ( 0 , 0 ) P 1 ( 321 , 328 ) P 2 ( 307 , 239 ). Now a is the largest horizontal distance possible it should be bigger than 321 and b vertical radius should be bigger than 328. What I was thinking is it is not always possible to draw an ellipse knowing the center and two other points.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in High school geometry

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?