Example usage for org.apache.commons.math.geometry Vector3D PLUS_I

List of usage examples for org.apache.commons.math.geometry Vector3D PLUS_I

Introduction

In this page you can find the example usage for org.apache.commons.math.geometry Vector3D PLUS_I.

Prototype

Vector3D PLUS_I

To view the source code for org.apache.commons.math.geometry Vector3D PLUS_I.

Click Source Link

Document

First canonical vector (coordinates: 1, 0, 0).

Usage

From source file:org.orekit.frames.EME2000Frame.java

/** Simple constructor.
 * @param name name of the frame//from w  ww.ja va  2 s  .  com
 */
protected EME2000Frame(final String name) {

    super(FramesFactory.getGCRF(), null, name, true);

    // build the bias transform
    final Rotation r1 = new Rotation(Vector3D.PLUS_I, D_EPSILON_B);
    final Rotation r2 = new Rotation(Vector3D.PLUS_J, -D_PSI_B * Math.sin(EPSILON_0));
    final Rotation r3 = new Rotation(Vector3D.PLUS_K, -ALPHA_0);
    final Rotation bias = r1.applyTo(r2.applyTo(r3));

    // store the bias transform
    setTransform(new Transform(bias));

}

From source file:org.orekit.frames.ITRF2005Frame.java

/** Update the frame to the given date.
 * <p>The update considers the pole motion from IERS data.</p>
 * @param date new value of the date/*from   w  ww .  j av  a2  s . co m*/
 * @exception OrekitException if the nutation model data embedded in the
 * library cannot be read
 */
protected void updateFrame(final AbsoluteDate date) throws OrekitException {

    if ((cachedDate == null) || !cachedDate.equals(date)) {

        // offset from J2000 epoch in julian centuries
        final double tts = date.durationFrom(AbsoluteDate.J2000_EPOCH);
        final double ttc = tts / Constants.JULIAN_CENTURY;

        // pole correction parameters
        final PoleCorrection pCorr = ((TIRF2000Frame) getParent()).getPoleCorrection(date);
        final PoleCorrection nCorr = nutationCorrection(date);

        // elementary rotations due to pole motion in terrestrial frame
        final Rotation r1 = new Rotation(Vector3D.PLUS_I, -(pCorr.getYp() + nCorr.getYp()));
        final Rotation r2 = new Rotation(Vector3D.PLUS_J, -(pCorr.getXp() + nCorr.getXp()));
        final Rotation r3 = new Rotation(Vector3D.PLUS_K, S_PRIME_RATE * ttc);

        // complete pole motion in terrestrial frame
        final Rotation wRot = r3.applyTo(r2.applyTo(r1));

        // combined effects
        final Rotation combined = wRot.revert();

        // set up the transform from parent TIRF
        setTransform(new Transform(combined, Vector3D.ZERO));
        cachedDate = date;

    }
}

From source file:org.orekit.frames.LocalOrbitalFrame.java

/** {@inheritDoc} */
protected void updateFrame(final AbsoluteDate date) throws OrekitException {

    // get position/velocity with respect to parent frame
    final PVCoordinates pv = provider.getPVCoordinates(date, getParent());
    final Vector3D p = pv.getPosition();
    final Vector3D v = pv.getVelocity();
    final Vector3D momentum = pv.getMomentum();

    // compute the translation part of the transform
    final Transform translation = new Transform(p.negate(), v.negate());

    // compute the rotation part of the transform
    final Rotation r = new Rotation((type == LOFType.TNW) ? v : p, momentum, Vector3D.PLUS_I, Vector3D.PLUS_K);
    final Transform rotation = new Transform(r, new Vector3D(1.0 / p.getNormSq(), r.applyTo(momentum)));

    // update the frame defining transform
    setTransform(new Transform(translation, rotation));

}

From source file:org.orekit.frames.TEMEFrame.java

/** Update the frame to the given date.
 * <p>The update considers the nutation effects from IERS data.</p>
 * @param date new value of the date//from   ww  w.  j  a  va  2s  . c  o m
 * @exception OrekitException if the nutation model data embedded in the
 * library cannot be read
 */
protected void updateFrame(final AbsoluteDate date) throws OrekitException {

    if ((cachedDate == null) || !cachedDate.equals(date)) {

        // offset from J2000.0 epoch
        final double tts = date.durationFrom(AbsoluteDate.J2000_EPOCH);

        // evaluate the nutation elements
        setInterpolatedNutationElements(tts);

        // offset from J2000 epoch in julian centuries
        final double ttc = tts / Constants.JULIAN_CENTURY;

        // compute the mean obliquity of the ecliptic
        moe = ((MOE_3 * ttc + MOE_2) * ttc + MOE_1) * ttc + MOE_0;

        // get the IAU1980 corrections for the nutation parameters
        final NutationCorrection nutCorr = (eopHistory == null) ? NutationCorrection.NULL_CORRECTION
                : eopHistory.getNutationCorrection(date);

        final double deps = depsCurrent + nutCorr.getDdeps();
        final double dpsi = dpsiCurrent + nutCorr.getDdpsi();

        // compute the true obliquity of the ecliptic
        final double toe = moe + deps;

        // set up the elementary rotations for nutation
        final Rotation r1 = new Rotation(Vector3D.PLUS_I, toe);
        final Rotation r2 = new Rotation(Vector3D.PLUS_K, dpsi);
        final Rotation r3 = new Rotation(Vector3D.PLUS_I, -moe);

        // complete nutation
        final Rotation precession = r1.applyTo(r2.applyTo(r3));

        // set up the transform from parent MEME
        setTransform(new Transform(precession));

        cachedDate = date;

    }

}