Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So the solution is here:</p> <p>The parametrized formula of an ellipse:</p> <pre> x = x0 + a * cos(t) y = y0 + b * sin(t) </pre> <p>Let's put known coordinates of two points to it:</p> <pre> x1 = x0 + a * cos(t1) x2 = x0 + a * cos(t2) y1 = y0 + b * sin(t1) y2 = y0 + b * sin(t2) </pre> <p>Now we have a system of equations with 4 variables: center of ellipse (x0/y0) and two angles t1, t2</p> <p>Let's subtract equations in order to get rid of center coordinates:</p> <pre> x1 - x2 = a * (cos(t1) - cos(t2)) y1 - y2 = b * (sin(t1) - sin(t2)) </pre> <p>This can be rewritten (with product-to-sum identities formulas) as:</p> <pre> (x1 - x2) / (2 * a) = sin((t1 + t2) / 2) * sin((t1 - t2) / 2) (y2 - y1) / (2 * b) = cos((t1 + t2) / 2) * sin((t1 - t2) / 2) </pre> <p>Let's replace some of the equations:</p> <pre> r1: (x1 - x2) / (2 * a) r2: (y2 - y1) / (2 * b) a1: (t1 + t2) / 2 a2: (t1 - t2) / 2 </pre> <p>Then we get simple equations system:</p> <pre> r1 = sin(a1) * sin(a2) r2 = cos(a1) * sin(a2) </pre> <p>Dividing first equation by second produces:</p> <pre> a1 = arctan(r1/r2) </pre> <p>Adding this result to the first equation gives:</p> <pre> a2 = arcsin(r2 / cos(arctan(r1/r2))) </pre> <p>Or, simple (using compositions of trig and inverse trig functions):</p> <pre> a2 = arcsin(r2 / (1 / sqrt(1 + (r1/r2)^2))) </pre> <p>or even more simple:</p> <pre> a2 = arcsin(sqrt(r1^2 + r2^2)) </pre> <p>Now the initial four-equations system can be resolved with easy and all angles as well as eclipse center coordinates can be found.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload