Calculating the orbital elements from given state vectors