Example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D Vector3D

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D Vector3D

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D Vector3D.

Prototype

public Vector3D(double x, double y, double z) 

Source Link

Document

Simple constructor.

Usage

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

/** Build a transform from its primitive operations.
 * @param epoch reference epoch of the transform
 * @param t1 translation parameter along X axis (BEWARE, this is in mm)
 * @param t2 translation parameter along Y axis (BEWARE, this is in mm)
 * @param t3 translation parameter along Z axis (BEWARE, this is in mm)
 * @param r1 rotation parameter around X axis (BEWARE, this is in mas)
 * @param r2 rotation parameter around Y axis (BEWARE, this is in mas)
 * @param r3 rotation parameter around Z axis (BEWARE, this is in mas)
 * @param t1Dot rate of translation parameter along X axis (BEWARE, this is in mm/y)
 * @param t2Dot rate of translation parameter along Y axis (BEWARE, this is in mm/y)
 * @param t3Dot rate of translation parameter along Z axis (BEWARE, this is in mm/y)
 * @param r1Dot rate of rotation parameter around X axis (BEWARE, this is in mas/y)
 * @param r2Dot rate of rotation parameter around Y axis (BEWARE, this is in mas/y)
 * @param r3Dot rate of rotation parameter around Z axis (BEWARE, this is in mas/y)
 */// w ww.  jav a  2  s. c  o m
public HelmertTransformation(final AbsoluteDate epoch, final double t1, final double t2, final double t3,
        final double r1, final double r2, final double r3, final double t1Dot, final double t2Dot,
        final double t3Dot, final double r1Dot, final double r2Dot, final double r3Dot) {

    // conversion parameters to SI units
    final double mmToM = 1.0e-3;
    final double masToRad = 1.0e-3 * Constants.ARC_SECONDS_TO_RADIANS;

    this.epoch = epoch;
    this.cartesian = new PVCoordinates(new Vector3D(t1 * mmToM, t2 * mmToM, t3 * mmToM),
            new Vector3D(t1Dot * mmToM / Constants.JULIAN_YEAR, t2Dot * mmToM / Constants.JULIAN_YEAR,
                    t3Dot * mmToM / Constants.JULIAN_YEAR));
    this.rotationVector = new Vector3D(r1 * masToRad, r2 * masToRad, r3 * masToRad);
    this.rotationRate = new Vector3D(r1Dot * masToRad / Constants.JULIAN_YEAR,
            r2Dot * masToRad / Constants.JULIAN_YEAR, r3Dot * masToRad / Constants.JULIAN_YEAR);

}

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

@Test
public void testHelmert20052008() throws OrekitException {
    Frame itrf2008 = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame itrf2005 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2005.createTransformedITRF(itrf2008,
            "2005");
    Vector3D pos2005 = new Vector3D(1234567.8, 2345678.9, 3456789.0);

    // check the Helmert transformation as per http://itrf.ign.fr/ITRF_solutions/2008/tp_08-05.php
    AbsoluteDate date = new AbsoluteDate(2005, 1, 1, 12, 0, 0, TimeScalesFactory.getTT());
    Vector3D pos2008 = itrf2005.getTransformTo(itrf2008, date).transformPosition(pos2005);
    Vector3D generalOffset = pos2005.subtract(pos2008);
    Vector3D linearOffset = computeOffsetLinearly(-0.5, -0.9, -4.7, 0.000, 0.000, 0.000, 0.3, 0.0, 0.0, 0.000,
            0.000, 0.000, pos2005, 0.0);
    Vector3D error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), 2.0e-13 * pos2005.getNorm());

    date = date.shiftedBy(Constants.JULIAN_YEAR);
    pos2008 = itrf2005.getTransformTo(itrf2008, date).transformPosition(pos2005);
    generalOffset = pos2005.subtract(pos2008);
    linearOffset = computeOffsetLinearly(-0.5, -0.9, -4.7, 0.000, 0.000, 0.000, 0.3, 0.0, 0.0, 0.000, 0.000,
            0.000, pos2005, 1.0);//w  w  w  . j  a  va  2 s  . co  m
    error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), 2.0e-13 * pos2005.getNorm());

}

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

@Test
public void testHelmert20002005() throws OrekitException {
    Frame itrf2008 = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame itrf2000 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2000.createTransformedITRF(itrf2008,
            "2000");
    Frame itrf2005 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2005.createTransformedITRF(itrf2008,
            "2005");
    Vector3D pos2000 = new Vector3D(1234567.8, 2345678.9, 3456789.0);

    // check the Helmert transformation as per http://itrf.ign.fr/ITRF_solutions/2005/tp_05-00.php
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    Vector3D pos2005 = itrf2000.getTransformTo(itrf2005, date).transformPosition(pos2000);
    Vector3D generalOffset = pos2000.subtract(pos2005);
    Vector3D linearOffset = computeOffsetLinearly(0.1, -0.8, -5.8, 0.000, 0.000, 0.000, -0.2, 0.1, -1.8, 0.000,
            0.000, 0.000, pos2000, 0.0);
    Vector3D error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), FastMath.ulp(pos2000.getNorm()));

    date = date.shiftedBy(Constants.JULIAN_YEAR);
    pos2005 = itrf2000.getTransformTo(itrf2005, date).transformPosition(pos2000);
    generalOffset = pos2000.subtract(pos2005);
    linearOffset = computeOffsetLinearly(0.1, -0.8, -5.8, 0.000, 0.000, 0.000, -0.2, 0.1, -1.8, 0.000, 0.000,
            0.000, pos2000, 1.0);//w w w.  j av  a2 s.co  m
    error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), FastMath.ulp(pos2000.getNorm()));

}

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

@Test
public void testHelmert19972000() throws OrekitException {
    Frame itrf2008 = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame itrf2000 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2000.createTransformedITRF(itrf2008,
            "2000");
    Frame itrf97 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_97.createTransformedITRF(itrf2008, "97");
    Vector3D pos97 = new Vector3D(1234567.8, 2345678.9, 3456789.0);

    // check the Helmert transformation as per ftp://itrf.ensg.ign.fr/pub/itrf/ITRF.TP
    AbsoluteDate date = new AbsoluteDate(1997, 1, 1, 12, 0, 0, TimeScalesFactory.getTT());
    Vector3D pos2000 = itrf97.getTransformTo(itrf2000, date).transformPosition(pos97);
    Vector3D generalOffset = pos97.subtract(pos2000);
    Vector3D linearOffset = computeOffsetLinearly(6.7, 6.1, -18.5, 0.000, 0.000, 0.000, 0.0, -0.6, -1.4, 0.000,
            0.000, 0.002, pos2000, 0.0);
    Vector3D error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), 2.0e-11 * pos97.getNorm());

    date = date.shiftedBy(Constants.JULIAN_YEAR);
    pos2000 = itrf97.getTransformTo(itrf2000, date).transformPosition(pos97);
    generalOffset = pos97.subtract(pos2000);
    linearOffset = computeOffsetLinearly(6.7, 6.1, -18.5, 0.000, 0.000, 0.000, 0.0, -0.6, -1.4, 0.000, 0.000,
            0.002, pos2000, 1.0);/*from   ww  w . ja  va  2s.  c om*/
    error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), 6.0e-11 * pos97.getNorm());

}

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

@Test
public void testHelmert19932000() throws OrekitException {
    Frame itrf2008 = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame itrf2000 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2000.createTransformedITRF(itrf2008,
            "2000");
    Frame itrf93 = HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_93.createTransformedITRF(itrf2008, "93");
    Vector3D pos93 = new Vector3D(1234567.8, 2345678.9, 3456789.0);

    // check the Helmert transformation as per ftp://itrf.ensg.ign.fr/pub/itrf/ITRF.TP
    AbsoluteDate date = new AbsoluteDate(1988, 1, 1, 12, 0, 0, TimeScalesFactory.getTT());
    Vector3D pos2000 = itrf93.getTransformTo(itrf2000, date).transformPosition(pos93);
    Vector3D generalOffset = pos93.subtract(pos2000);
    Vector3D linearOffset = computeOffsetLinearly(12.7, 6.5, -20.9, -0.39, 0.80, -1.14, -2.9, -0.2, -0.6, -0.11,
            -0.19, 0.07, pos2000, 0.0);//  w  w w . ja va2  s . c  o m
    Vector3D error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), FastMath.ulp(pos93.getNorm()));

    date = date.shiftedBy(Constants.JULIAN_YEAR);
    pos2000 = itrf93.getTransformTo(itrf2000, date).transformPosition(pos93);
    generalOffset = pos93.subtract(pos2000);
    linearOffset = computeOffsetLinearly(12.7, 6.5, -20.9, -0.39, 0.80, -1.14, -2.9, -0.2, -0.6, -0.11, -0.19,
            0.07, pos2000, 1.0);
    error = generalOffset.subtract(linearOffset);
    Assert.assertEquals(0.0, error.getNorm(), FastMath.ulp(pos93.getNorm()));

}

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

private Vector3D computeOffsetLinearly(final double t1, final double t2, final double t3, final double r1,
        final double r2, final double r3, final double t1Dot, final double t2Dot, final double t3Dot,
        final double r1Dot, final double r2Dot, final double r3Dot, final Vector3D p, final double dt) {
    double t1U = (t1 + dt * t1Dot) * 1.0e-3;
    double t2U = (t2 + dt * t2Dot) * 1.0e-3;
    double t3U = (t3 + dt * t3Dot) * 1.0e-3;
    double r1U = FastMath.toRadians((r1 + dt * r1Dot) / 3.6e6);
    double r2U = FastMath.toRadians((r2 + dt * r2Dot) / 3.6e6);
    double r3U = FastMath.toRadians((r3 + dt * r3Dot) / 3.6e6);
    return new Vector3D(t1U - r3U * p.getY() + r2U * p.getZ(), t2U + r3U * p.getX() - r1U * p.getZ(),
            t3U - r2U * p.getX() + r1U * p.getY());
}

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

@Test
public void testAASReferenceLEO() throws OrekitException {

    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, new double[][] {
            { 53098, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53099, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53100, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53101, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53102, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53103, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53104, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN },
            { 53105, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN,
                    Double.NaN } }));
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009),
            TimeScalesFactory.getUTC());

    // ITRF//from ww  w . j  av a2s . c o m
    PVCoordinates pvITRF = new PVCoordinates(new Vector3D(-1033479.3830, 7901295.2754, 6380356.5958),
            new Vector3D(-3225.636520, -2872.451450, 5531.924446));

    // GTOD
    PVCoordinates pvGTOD = new PVCoordinates(new Vector3D(-1033475.0313, 7901305.5856, 6380344.5328),
            new Vector3D(-3225.632747, -2872.442511, 5531.931288));

    Transform t = FramesFactory.getGTOD(IERSConventions.IERS_1996, true)
            .getTransformTo(FramesFactory.getITRFEquinox(IERSConventions.IERS_1996, true), t0);
    checkPV(pvITRF, t.transformPVCoordinates(pvGTOD), 8.08e-5, 3.78e-7);

}

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

@Test
public void testAASReferenceGEO() throws OrekitException {

    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, new double[][] {
            { 53153, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53154, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53155, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53156, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53157, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53158, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53159, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN },
            { 53160, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN,
                    Double.NaN } }));
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 06, 01), TimeComponents.H00,
            TimeScalesFactory.getUTC());

    Transform t = FramesFactory.getGTOD(IERSConventions.IERS_1996, true)
            .getTransformTo(FramesFactory.getITRFEquinox(IERSConventions.IERS_1996, true), t0);

    // GTOD//from   ww w  .j  a va 2s  . com
    PVCoordinates pvGTOD = new PVCoordinates(new Vector3D(24796919.2956, -34115870.9001, 10293.2583),
            new Vector3D(-0.979178, -1.476540, -0.928772));

    // ITRF
    PVCoordinates pvITRF = new PVCoordinates(new Vector3D(24796919.2915, -34115870.9234, 10226.0621),
            new Vector3D(-0.979178, -1.476538, -0.928776));

    checkPV(pvITRF, t.transformPVCoordinates(pvGTOD), 3.954e-4, 4.69e-7);

}

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

@Test
public void testAASReferenceLEO() throws OrekitException {

    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    // Reference position & velocity from : "Fundamentals of Astrodynamics and Applications", Third edition, David A. Vallado
    Utils.setLoaders(IERSConventions.IERS_2010, Utils.buildEOPList(IERSConventions.IERS_2010, new double[][] {
            { 53098, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53099, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53100, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53101, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53102, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53103, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53104, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53105, -0.4399619, 0.0015563, -0.140682, 0.333309, Double.NaN, Double.NaN, -0.000199,
                    -0.000252 } }));/*from ww w.  j a va 2s  .  co  m*/
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009),
            TimeScalesFactory.getUTC());

    // Positions LEO
    Frame itrfA = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    PVCoordinates pvITRF = new PVCoordinates(new Vector3D(-1033479.3830, 7901295.2754, 6380356.5958),
            new Vector3D(-3225.636520, -2872.451450, 5531.924446));

    // Reference coordinates
    PVCoordinates pvGcrfIau2000A = new PVCoordinates(new Vector3D(5102508.9579, 6123011.4038, 6378136.9252),
            new Vector3D(-4743.220156, 790.536497, 5533.755728));
    checkPV(pvGcrfIau2000A, itrfA.getTransformTo(FramesFactory.getGCRF(), t0).transformPVCoordinates(pvITRF),
            0.0192, 2.15e-5);

    PVCoordinates pvEME2000EqA = new PVCoordinates(new Vector3D(5102509.0383, 6123011.9758, 6378136.3118),
            new Vector3D(-4743.219766, 790.536344, 5533.756084));
    checkPV(pvEME2000EqA, itrfA.getTransformTo(FramesFactory.getEME2000(), t0).transformPVCoordinates(pvITRF),
            0.0191, 2.13e-5);

}

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

@Test
public void testAASReferenceGEO() throws OrekitException {

    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_2010, Utils.buildEOPList(IERSConventions.IERS_2010, new double[][] {
            { 53153, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53154, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53155, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53156, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53157, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53158, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53159, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 },
            { 53160, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199,
                    -0.000252 } }));//from   w w w.j  a va 2s .c  om

    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 06, 01), TimeComponents.H00,
            TimeScalesFactory.getUTC());

    //  Positions GEO
    Frame itrfA = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    PVCoordinates pvITRF = new PVCoordinates(new Vector3D(24796919.2915, -34115870.9234, 10226.0621),
            new Vector3D(-0.979178, -1.476538, -0.928776));

    PVCoordinates pvGCRFiau2000A = new PVCoordinates(new Vector3D(-40588150.3617, -11462167.0397, 27143.1974),
            new Vector3D(834.787458, -2958.305691, -1.172993));
    checkPV(pvGCRFiau2000A, itrfA.getTransformTo(FramesFactory.getGCRF(), t0).transformPVCoordinates(pvITRF),
            0.0806, 1.03e-4);

    PVCoordinates pvEME2000EqA = new PVCoordinates(new Vector3D(-40588149.5482, -11462169.9118, 27146.8462),
            new Vector3D(834.787667, -2958.305632, -1.172963));
    checkPV(pvEME2000EqA, itrfA.getTransformTo(FramesFactory.getEME2000(), t0).transformPVCoordinates(pvITRF),
            0.0806, 1.04e-4);

}