Esempio n. 1
0
        public static void FoundIntersection(Vessel vessel, Tuple <double, double> LZ)
        {
            Vector2 ls = new Vector2((float)(vessel.Flight(vessel.SurfaceReferenceFrame).Latitude - LZ.Item1),
                                     (float)(vessel.Flight(vessel.SurfaceReferenceFrame).Longitude - LZ.Item2));

            double lp = Calculs.VectorScal(ls, targetedTrajectory) / targetedTrajectory.Length();

            float alpha = (float)Calculs.VectorAngleWithNegative(targetedTrajectory);

            Vector2 LP = new Vector2((float)(lp * Math.Cos(alpha)), (float)(lp * Math.Sin(alpha)));

            intersection = new Vector2((float)LZ.Item1, (float)LZ.Item2) + LP;



            float beta = (float)Calculs.VectorAngleWithNegative(ls);

            teta = (float)((beta - alpha) % Math.PI);
        }