Polar equation of an ellipse given the origin coordinates and major and minor axis lengths? I've been trying to create a polar equation that will give me all points on an ellipse with the independent variable being theta and the dependent variable being the radius, but I'm having a great deal of trouble wrapping my mind around how to accomplish such a feat.

The ellipse is going to be defined by it's origin's x and y positions, it's major axis length, and it's minor axis length. It can be assumed that in every case the major axis is perfectly vertical and the minor axis is perfectly horizontal.



Not really relevant to the answer, but just a little more background information. I am trying to program hit detection for a game that uses ellipses for the hitbox boundaries. The reason I need an equation like this is that I am going to be determining whether an object is within the hitbox by comparing the distance from the ellipse's center to a point on the object with the distance from the ellipse's center to the point along the ellipse in the direction of the point on the object.



Any feedback is appreciated.
Divide your major and your minor axes by $2$ to get the "major radius" and "minor radius". Call these $a$ and $b$. (A major and minor axis length don't uniquely specify an ellipse, you'll still have to decide if it's wider than long or longer than wide, so you'll have to make that choice here). 

Substitute them into the usual equation of an ellipse.

$$\left(\frac{x}{a}\right)^2 + \left(\frac{y}{b}\right)^2 = 1$$

Substitute in $x = r\cos(\theta), y = r\sin(\theta)$.

$$
\begin{aligned}
\left(\frac{r\cos(\theta)}{a}\right)^2 + \left(\frac{r\sin(\theta)}{b}\right)^2 &amp;= 1\\
\frac{r^2\cos^2(\theta)}{a^2} + \frac{r^2\sin^2(\theta)}{b^2} &amp;= 1\\
\frac{r^2\cos^2(\theta)b^2}{a^2b^2} + \frac{r^2\sin^2(\theta)a^2}{b^2a^2} &amp;= 1\\
r^2(b^2\cos^2(\theta) + a^2\sin^2(\theta)) &amp;= a^2b^2\\
r^2 &amp;= \frac{a^2b^2}{b^2\cos^2(\theta) + a^2\sin^2(\theta)}\\
r &amp;= \frac{ab}{\sqrt{b^2\cos^2(\theta) + a^2\sin^2(\theta)}}\\
\end{aligned}
$$
HINTS:

For a start we can use standard  parametric equations $ (r,\theta),(x,y) $ and then convert to Cartesian coordinates, translate by $ (h,k) $ re-convert to required polar equation  $ \rho = f( \gamma ).  $  

$$
r= p/ (1- \epsilon \cos \theta) ; x= r \cos\theta + h ; y= r \sin \theta +k ; \rho^2 = x^2 + y^2 ; \gamma = \tan^{-1} {\frac{y}{x}};
$$

There are two ellipse tangent limits for $\gamma$ limits each of constant value, two variable radius $\rho$ limits for each intermediate $\gamma$ value as shown.

Mathematica program if helpful:

ecc = 0.6; p = 1.; h = 3.; k = 2.; r[t_] = p/(1 - ecc Sin[t]);
ell = ParametricPlot[ r[t] {Cos[t], Sin[t]}, {t, 0, 2 Pi}, 
   PlotStyle -&gt; {Thick, Magenta}];
rho[t_] = Sqrt[r[t]^2 + h^2 + k^2 + 2 r[t] ( h Cos[t] + k Sin[t])]; 
gam[t_] = ArcTan[   r [t] Cos[t] +h, r [t] Sin[t] +k ] ;
displ = ParametricPlot[ 
   rho[t] {Cos[gam[t]], Sin[gam[t]]}, {t, 0, 2 Pi}, 
   PlotStyle -&gt; {Thick, Red}];
Show[{ell, displ}, PlotRange -&gt; All, GridLines -&gt; Automatic]




To  find polar angle $ \gamma $ of  tangential contact to radius vector, next use the condition 

$$ \frac{d \gamma}{d \rho} =0  $$

and then proceed radial transversal intersection limits... 

(If you want to locate target area of displaced ellipses, calculation with pole/polar of ellipse is perhaps best, but it is not mentioned here).