The equation of an ellipse with semimajor axis and eccentricity rotated by radians about its center at the origin is .
The equation of a line through the point and cutting the axis at an angle is .
Solving these two equations simultaneously gives the two points of intersection of the line with the rotating ellipse. The line is tangent if these two points coincide. This happens with the angle that satisfies the equation that sets the two coordinates of the intersection points equal, .