Example 19 A rod AB of length 15 cm rests in between two coordinate axes in such a way that the end point A lies on x-axis and end point B lies on y-axis. A point P(x, y) is taken on the rod in such a way that AP = 6 cm. Show that the locus of P is an ellipse.