Calculate angle of inclination for a certain angle in a planet's orbit? The background is that I'm trying to write a computer program to show at what angles each planet would be able to be seen transiting in front of the sun from an observer outside our solar system.  My endgame is to calculate the relative percentages of the sky that could see any group of planets transiting together.  For instance in the direction the Earth is from the sun in June and December, an alien observer that could see Earth transit could also see Venus transit, but from the angle where the Earth is in September or March they would not ever be able to see Venus transit.

I wrote a program using basic stats and circular orbits to test out the idea, but I would like to make it more robust using actual elliptical orbits and I'm having trouble.  For circular orbits with the sun at the center I was able to just take the inclination of Earth's orbit times the sin of the viewing longitude relative to the longitude of ascention.

double viewingLongitude = longitudeRadians - LongitudeOfAscent;
double planetAngle = Inclination * Math.Sin(viewingLongitude);


For instance Earth's orbit has an inclination of 1.57 degrees and longitude of ascent at 348.74 degrees.  At 348.74 degrees and 168.74 degrees Earth will have an actual inclination of 0 degrees.  At 78.74 degrees and 158.74 degrees Earth will have an actual inclination of 1.57 and -1.57 degrees from the plane.

Is there a similar easy way I could calculate that inclination for the elliptical orbit of the Earth or will I have to solve Kepler's equations?
In short, no, you don't have to solve Kepler's equation. If you define a viewing longitude and you know the full set of Keplerian orbital elements, you can calculate if a planet will show a transit.

Let me first clear up some of the jargon, though. The term inclination is traditionally reserved for the angle between the orbital plane and the reference plane. So unless the entire orbit is wobbling (for instance due to precession) the inclination will be constant for all positions of the planet.

The angle that varies as the planet moves through the reference plane is the latitude. However, in this particular problem calculating the latitude isn't particularly useful. The more practical coordinate to look at is the height of the planet away from the plane, I'll call this $r_z$. If along your observers line of sight you find $r_z$ to be smaller than the solar radius, the planet will show a transit.

Working out a fully general elliptical orbit in 3 dimensions is somewhat tricky, so I'll start out with a simple Cartesian coordinate system aligned with the orbital plane. In subsequent steps I work my way back using a number of coordinate transformations.

First a list of the Kepler parameters and their meaning:


$\nu$ - true anomaly - The anglular position with respect to perigee in the orbital plane.
$\omega$ - argument of periapsis - The angular position of perigee with respect to the ascending node in the orbital plane.
$\lambda_{asc}$ - the longitude of ascending node in the invariable plane ($\Omega$ in the picture).
$i$ - inclination - the angle between the orbital plane and the invariable plane, such that $\lambda_{asc}$ gives the rotation axis. 




Now, in the orbital plane, the radius of the planet orbit is given as
$$
r(\nu) = \frac{a(1-e^2)}{1+e\cos(\nu)}
$$
If I define the x-axis to align with the ascending node, I can write the position vector as
$$
\vec{r}_{orb} = r(\nu) 
\begin{bmatrix} 
\cos(\omega+\nu) \\ 
\sin(\omega+\nu) \\ 
0 
\end{bmatrix}
$$

To move to a Cartesian coordinate system aligned with the invariable plane I have to apply a rotation of angle $i$ about the x-axis, so
$$
\vec{r} = R_x(i)\vec{r}_{orb}= r(\nu)
\begin{bmatrix} 
\cos(\omega+\nu) \\ 
\sin(\omega+\nu)\cos(i) \\ 
\sin(\omega+\nu)\sin(i)
\end{bmatrix}
$$
So now I have an expression for $r_z$, I just need to know how $\nu$ relates to the planet longitude in the invariable plane, $\lambda_{planet}$.

I can find the longitude of the planet relative to $\lambda_{asc}$ as
$$
\lambda'_{planet} = \arctan( \frac{r_y}{r_x} ) 
$$ 
such that the actual longitude is
$$
\lambda_{planet} = \lambda_{asc} + \lambda'_{planet}
$$
Inverting this last expression gives
$$
\nu(\lambda) = \arctan( \frac{\tan(\lambda - \lambda_{asc})}{\cos(i)} ) - \omega
$$

Now I have all the equations to answer the question:
If the planet is along the observer's line of sight, then is has a true anomaly 
of $\nu(\lambda_{obs})$, which gives a height above the plane
$$
r_z(\nu) = r(\nu)\sin(\omega+\nu)\sin(i)
$$
If $|r_{z}| &lt; R_{sun}$ the planet can be seen in transit.