This is an extension of the question here and for context, I'm writing a script for Google Earth that generates a tour, and aims the camera in the current direction of the velocity vector.
Heading can be calculated using the information from the linked question, but how is the tilt, relative to the first point's local coordinate system, calculated? 0 degrees is parallel to the surface of the earth, and 90 degrees is looking straight down.