public GroundMarker(KSPOrbitModule.GeoCoordinates geoCoordinates, KSPConsoleModule.RgbaColor color,
                     double rotation)
 {
     Color          = color;
     GeoCoordinates = geoCoordinates;
     Rotation       = rotation;
     Visible        = true;
 }
            public GroundMarker AddGroundMarker(KSPOrbitModule.GeoCoordinates geoCoordinates,
                                                KSPConsoleModule.RgbaColor color, double rotation)
            {
                GroundMarker groundMarker = new GroundMarker(geoCoordinates, color, rotation);

                KSPContext.CurrentContext.AddMarker(groundMarker);

                return(groundMarker);
            }
            public double HeadingTo(KSPOrbitModule.GeoCoordinates geoCoordinates)
            {
                var up    = Up;
                var north = North;

                var targetWorldCoords = MainBody.SurfacePosition(geoCoordinates.Latitude, geoCoordinates.Longitude,
                                                                 geoCoordinates.TerrainHeight);

                var vector   = Vector3d.Exclude(Up, targetWorldCoords - CoM).normalized;
                var headingQ =
                    Quaternion.Inverse(Quaternion.Euler(90, 0, 0) *
                                       Quaternion.Inverse(Quaternion.LookRotation(vector, up)) *
                                       Quaternion.LookRotation(north, up));

                return(headingQ.eulerAngles.y);
            }