angular velocity around ellipse If I have velocity at perihelion/apphelion, distance away from sun at perihelion/apphelion, and orbital period. How can I find the angular velocity function for earth and subsequently all the other planets in the solar system? 
 A: Kepler's second law specifies
$$\frac1{2}r^2\frac{d\theta}{dt} = \frac{\pi ab}{P},$$
where $P$ is the period and $a$ and $b$ are the lengths of the semi-major and sem-minor axes, respectively, for the elliptical orbit.  This means that the constant rate -- at which a line segment between the planet and the sun sweeps out area -- equals the area of the ellipse divided by the time required to complete one orbit.
In polar coordinates the velocity is
$$\mathbf{v} = \frac{dr}{dt}\mathbf{e}_r + r\frac{d \theta}{dt}\mathbf{e}_{\theta},$$
and the magnitude of angular velocity is
$$\mathbf{\omega}= \frac{|\mathbf{r}\times\mathbf{v}|}{r^2}= \frac{d \theta}{dt}.$$
Whence, 
$$\omega(r) = \frac{d\theta}{dt} = \frac{2\pi ab}{Pr^2}.$$
Using some analytic geometry you can relate $a$ and $b$ to the perihelion ($d_p$) and aphelion ($d_a$) distances. Let the distance between the foci be $2c$.  Note that the center of the sun is located at one focus. We have the following relationships:
$$b^2 = a^2 - c^2,\\a+c = d_a,\\a-c= d_p.$$
Solving for $a$ and $b$ we get
$$a = \frac{d_a + d_p}{2}, \,\,\,\,b = \sqrt{d_ad_p}.$$
Substituting into the expression for angular velocity, we get
$$\omega(r) = \frac{d\theta}{dt} = \frac{\pi }{Pr^2}(d_a + d_p)\sqrt{d_ad_p}.$$
