Intereting Posts

On the solution of constant coefficients PDEs (exponential method)
Why is the inradius of any triangle at most half its circumradius?
A improper integral with complex parameter
On the ring of integers of a compositum of number fields
What is the pmf of rolling a die until obtaining three consecutive $6$s?
Prime Ideals and multiplicative sets
What does triple convolution actually look like?
Proof by Induction: Alternating Sum of Fibonacci Numbers
Calculate (or estimate) $S(x)=\sum_{k=1}^\infty \frac{\zeta(kx)}{k!}$.
Hahn-Banach theorem: 2 versions
Find the value of : $\lim\limits_{n\rightarrow\infty}\left({2\sqrt n}-\sum\limits_{k=1}^n\frac{1}{\sqrt k}\right)$
Find the number of $n$ by $n$ matrices conjugate to a diagonal matrix
Finding a solution to $\sum _{n=1}^{n=k} \frac{1}{n^x}+\sum _{n=1}^{n=k} \frac{1}{n^y}=0$
polynomials such that $P(k)=Q(l)$ for all integer $k$
Topology induced by the completion of a topological group

I’m attempting to generate an ellipse for a stair simulation game of mine, and the inputs are:

- A point on the ellipse
- The slope of the tangent line to the ellipse at that point
- Another point on the ellipse
- The slope of the tangent line to the ellipse at that point
- A point on the ellipse in-between the two previous points

I’ve heard that these five items are enough to generate an ellipse equation – how is it done? Also, how can it be put into $f(x)$ format?

Thanks in advance for any help!

- Are vector bundles on $\mathbb{P}_{\mathbb{C}}^n$ of any rank completely classified? (main interest $n=3$)
- If $A$ is reduced, Spec $A$ has no embedded points
- Why is the disjoint union of a finite number of affine schemes an affine scheme?
- Tensor product of 2 coordinate rings
- Proving algebraic sets
- Intuitive definitions of the Orbit and the Stabilizer

- Hartshorne Exercise II. 3.19 (b)
- Is it true that for algebraic sets $V,W$ we have $I(V \times W ) =I(V) + I(W)$?
- Cardinality and degrees of irreducible components of an affine variety
- Trouble with Vakil's FOAG exercise 11.3.C
- The sum of three colinear rational points is equal to $O$
- isolated non-normal surface singularity
- Set of points where ring of germs is reduced is open
- What is the zero subscheme of a section
- Gluing sheaves - can we realize $\mathcal{F}(W)$ as some kind of limit?
- Trying to understand the use of the “word” pullback/pushforward.

The equation of a general conic section has the form

$$A x^2 + 2 B x y + C y^2 + 2 D x + 2 E y + F = 0 \qquad(\star)$$

where the condition $B^2 – AC < 0$ indicates an ellipse. Implicit differentiation gives a relation involving the slope (which I’ll write as $m$) at the point $(x,y)$:

$$A x + B( y + x m ) + C y m + D + E m = 0 \qquad(\star\star)$$

Your inputs include three points (say, $P_0 = (x_0, y_0)$, $P_1 = (x_1, y_1)$, and $P_2 = (x_2,y_2)$) and two slopes-at-points (say, $m_1$ at $P_1$, and $m_2$ at $P_2$). These give you three particular instances of $(\star)$, and two of $(\star\star)$; that’s *five* linear equations in the *six* unknowns $A$, $B$, $C$, $D$, $E$, $F$. Having a spare unknown isn’t so bad here, since the system of equations is *homogeneous*; effectively, we can divide-through by one of the unknowns, reducing the count to five.

Solving the system is easy enough to do numerically (which you could probably do within your simulation program), and usually fairly ugly to do symbolically. As has been mentioned in a comment, since an ellipse is not the graph of a function, it can’t be “put into $f(x)$ format” … at least, perhaps not in the way you might be thinking. However, if you use *polar coordinates*, and make the assumption that, say, $P_0$ lies at the origin, then you can arrive at not-too-horrible symbolic equation for the ellipse.

In what follows, I take $P_0$ to be the origin. (Note that this gives us $F=0$ immediately.) We’ll give our other points polar coordinates, $P_i = (r_i, \theta_i)$, and we’ll also express the slopes at these points in terms of angles: $m_i = \tan\phi_i$.

With $F=0$, we find that the polar form of $(\star)$ —derived with the substitutions $x = r\;\cos\theta$ and $y = r\;\sin\theta$— has a factor of $r$ representing the solution-point of the origin itself. Solving the other factor for $r$ gives this polar equation for the conic section

$$r = \frac{- 2\left( D\cos\theta + E\sin\theta \right)}{A\cos^2\theta + 2 B\cos\theta\sin\theta+C\sin^2\theta}$$

We have therefore put the conic in “$r = f(\theta)$ format”.

Now, having tediously solved for coefficients $A$ through $E$, it turns out that the above becomes

$$r = \frac{r_1 r_2 \sin\Delta \left(

\begin{array}{c}

\phantom{-} r_1 \sin\Delta_1\; (\;\cos(\theta-\phi_2) \cos\Delta – \cos((\theta-\theta_1)-\Delta_2) \;) \\

– r_2 \sin\Delta_2\; (\;\cos(\theta-\phi_1) \cos\Delta

– \cos((\theta-\theta_2)-\Delta_1)\;)

\end{array}

\;\;\right)}{\sin\Delta_1 \sin\Delta_2\; (\;r_1 \sin(\theta-\theta_1) – r_2 \sin(\theta-\theta_2)\;)^2 –

r_1 r_2 \sin(\theta-\phi_1)\sin(\theta-\phi_2) \sin^2\Delta}$$

where $\Delta = \theta_1-\theta_2$ and $\Delta_i = \theta_i – \phi_i$.

The condition $B^2-AC < 0$ for the curve to be an ellipse reduces to:

$$\begin{align}

&\;4 \; \sin(\theta_1-\phi_1) \;\sin(\theta_2-\phi_2) \\

&\;\;\cdot\left(\; r_1 \sin(\theta_1 – \phi_1) – r_2 \sin(\theta_2 – \phi_1) \;\right) \\

&\;\;\cdot\left(\; r_1 \sin(\theta_1 – \phi_2) – r_2 \sin(\theta_2 – \phi_2) \;\right) \\

&+ r_1 r_2\;\sin^2(\theta_1-\theta_2)\;\sin^2(\phi_1 – \phi_2) \qquad<\; 0

\end{align}$$

where $r_1$, $r_2$ are assumed strictly positive, and angles $\theta_1$ and $\theta_2$ are distinct. (Otherwise, append the factor $r_1 r_2 \sin^2(\theta_1-\theta_2)$ to the left-hand side.)

(Aside: The above was derived through fairly arduous and mechanical symbol manipulation, but the final result seems as though it wants to say something profound about the geometry of the situation. Hmmmm …)

So, for example, given polar inputs …

$$P_0 = (0,0)\qquad P_1 = \left(1,\frac{\pi}{3}\right) \qquad P_2 = \left(2,-\frac{\pi}{4}\right) \qquad \phi_1 = \frac{\pi}{6} \qquad \phi_2 = -\frac{\pi}{6}$$

… the result is this ellipse:

- Equation of a plane containing a point and perpendicular to a line
- Iterations with matrices over simple fields approximating solutions for more complicated fields.
- Are Primes a Self-Fulfilling Prophecy?
- Why not defining random variables as equivalence classes?
- Understanding limsup
- The image of a proper scheme is closed
- Automorphisms in $Z_n$
- Application of PIE
- Goat tethered in a circular pen
- Possible values of prime gaps
- Getting the grip of geometry and Algebra; books and resources for a beginner
- Solving $x^e =c$ in $\mathbb{F}_{p}$
- Evaluating the series $\sum\limits_{n=1}^\infty \frac1{4n^2+2n}$
- Group of order pq is not simple
- Find an expression for the $n$-th derivative of $f(x)=e^{x^2}$