Ejemplo n.º 1
0
        public static double DistanceToKerbin(LaserSailModule sail, Orbit orbit, Vector3d normal, double UT)
        {
            Vector3d homePosition     = FlightGlobals.Bodies[1].getPositionAtUT(UT);
            Vector3d ownPosition      = orbit.getPositionAtUT(UT);
            Vector3d relativePosition = ownPosition - homePosition;

            double output = relativePosition.magnitude - 600000;

            return(output);
        }
Ejemplo n.º 2
0
        public static Vector3d CalculateLaserForce(LaserSailModule sail, Orbit orbit, Vector3d normal, double UT)
        {
            Vector3d homePosition     = FlightGlobals.Bodies[1].getPositionAtUT(UT);
            Vector3d ownPosition      = orbit.getPositionAtUT(UT);
            Vector3d relativePosition = ownPosition - homePosition;
            //if (Vector3d.Dot(normal, ownsunPosition) < 0)
            //{
            //    normal = -normal;
            //}

            double angleDeviation = Vector3.Dot(relativePosition.normalized, normal);


            Vector3d force = normal * (angleDeviation * sail.laserForce * Math.Pow(70000 / (relativePosition.magnitude - 600000), 2));

            return(force);
        }