Example #1
0
    def fromOrbitalElements(a, b, e, i, long_asc, arg_per, M, true_lon,
                            arg_lat, lon_per, p, mu):
        """
        a:         semi major axis (km)
        b:         semi minor axis (km)
        e:     eccentricity (unitless)
        i:         inclination (radians)
        long_asc: Right ascention of the ascending node (radians)
        arg_per:   argument of perigee (radians)
        M:         mean anomaly (radians)
        true_lon:  True Longtitude (radians)
        arg_lat:   argument of latitude (radians)
        long_per:  Longtitude of periapse (radians)
        p: semilatus rectum (km)
        mu:  gravitational constant
        """

        hval = b * sqrt(mu / a)
        h_vec1 = Vector3.Z().rotate(Rotation.aroundY(i))
        h_vec = h_vec1.rotate(Rotation.aroundZ(long_asc - pi / 2.0))
        x = Vector3.X()
        rot_long_asc = Rotation.aroundZ(long_asc)
        n_dir = x.rotate(rot_long_asc).norm()
        n_vec = Vector3.Z().cross(h_vec)

        KeplerOrbit2(a, b, e, i, long_asc, arg_per, M, true_lon, arg_lat,
                     lon_per, p, mu, n_vec, h_vec)
Example #2
0
    def fromOrbitalElements(a, b, e, i, long_asc, arg_per, M, true_lon, arg_lat, lon_per, p, mu):
        """
        a:         semi major axis (km)
        b:         semi minor axis (km)
        e:     eccentricity (unitless)
        i:         inclination (radians)
        long_asc: Right ascention of the ascending node (radians)
        arg_per:   argument of perigee (radians)
        M:         mean anomaly (radians)
        true_lon:  True Longtitude (radians)
        arg_lat:   argument of latitude (radians)
        long_per:  Longtitude of periapse (radians)
        p: semilatus rectum (km)
        mu:  gravitational constant
        """

        hval = b*sqrt(mu/a)
        h_vec1 = Vector3.Z().rotate(Rotation.aroundY(i))
        h_vec = h_vec1.rotate(Rotation.aroundZ(long_asc - pi/2.0))
        x = Vector3.X()
        rot_long_asc = Rotation.aroundZ(long_asc)
        n_dir = x.rotate(rot_long_asc).norm()
        n_vec = Vector3.Z().cross(h_vec)

        KeplerOrbit2(
                a,
                b,
                e,
                i,
                long_asc,
                arg_per,
                M,
                true_lon,
                arg_lat,
                lon_per,
                p,
                mu,
                n_vec,
                h_vec)