Flybys have been utilized in interplanetary spaceflight since the 1970’s. However, despite the experience and expertise regarding their use, the source of anomalous tracking data for multiple spacecraft as they flew by the Earth in the 1990’s and 2000’s, known as the flyby anomaly, remains unknown. This paper proposes some foundational techniques of setting up planetocentric reference frames to analyze the relative orbital motion of celestial bodies and flyby maneuvers of spacecraft, which could better examine the source of the flyby anomaly. Beginning with a geometric description of two orbits in the barycentric (center of mass) reference frame of the solar system, we performed two transformations to create the planetocentric reference frame: translating the coordinate frame onto the planet in circular orbit and then setting the coordinate frame to rotate with the angular revolution of velocity of the planet about the center of mass.