List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D MINUS_I
Vector3D MINUS_I
To view the source code for org.apache.commons.math3.geometry.euclidean.threed Vector3D MINUS_I.
Click Source Link
From source file:org.orekit.forces.BoxAndSolarArraySpacecraft.java
/** Build the surface vectors for body facets of a simple parallelepipedic box. * @param xLength length of the body along its X axis (m) * @param yLength length of the body along its Y axis (m) * @param zLength length of the body along its Z axis (m) * @return surface vectors array// w w w. jav a 2s .com */ private static Facet[] simpleBoxFacets(final double xLength, final double yLength, final double zLength) { return new Facet[] { new Facet(Vector3D.MINUS_I, yLength * zLength), new Facet(Vector3D.PLUS_I, yLength * zLength), new Facet(Vector3D.MINUS_J, xLength * zLength), new Facet(Vector3D.PLUS_J, xLength * zLength), new Facet(Vector3D.MINUS_K, xLength * yLength), new Facet(Vector3D.PLUS_K, xLength * yLength) }; }
From source file:org.orekit.frames.EclipticProvider.java
@Override public Transform getTransform(final AbsoluteDate date) throws OrekitException { //mean obliquity of date final double epsA = obliquity.value(date); return new Transform(date, new Rotation(Vector3D.MINUS_I, epsA)); }
From source file:org.orekit.frames.ITRFProviderWithoutTidalEffectsTest.java
@Test public void testRoughOrientation() throws OrekitException { AbsoluteDate date = new AbsoluteDate(2001, 03, 21, 0, 4, 0, TimeScalesFactory.getUTC()); Frame itrf2008 = FramesFactory.getITRF(IERSConventions.IERS_2010, true); Vector3D u = itrf2008.getTransformTo(FramesFactory.getEME2000(), date).transformVector(Vector3D.PLUS_I); Assert.assertTrue(Vector3D.angle(u, Vector3D.MINUS_I) < FastMath.toRadians(0.5)); date = date.shiftedBy(6 * 3600);/*from w w w. ja va 2s . co m*/ u = itrf2008.getTransformTo(FramesFactory.getEME2000(), date).transformVector(Vector3D.PLUS_I); Assert.assertTrue(Vector3D.angle(u, Vector3D.MINUS_J) < FastMath.toRadians(0.5)); date = date.shiftedBy(6 * 3600); u = itrf2008.getTransformTo(FramesFactory.getEME2000(), date).transformVector(Vector3D.PLUS_I); Assert.assertTrue(Vector3D.angle(u, Vector3D.PLUS_I) < FastMath.toRadians(0.5)); date = date.shiftedBy(6 * 3600); u = itrf2008.getTransformTo(FramesFactory.getEME2000(), date).transformVector(Vector3D.PLUS_I); Assert.assertTrue(Vector3D.angle(u, Vector3D.PLUS_J) < FastMath.toRadians(0.5)); }
From source file:org.orekit.frames.SpacecraftFrameTest.java
@Before public void setUp() { try {/*from w w w . ja v a 2 s . c o m*/ Utils.setDataRoot("regular-data"); // Orbit double mu = 3.986004415e14; double a = 7178000.0; double ex = 0.5e-4; double ey = 0.5e-4; double i = FastMath.toRadians(50.); double raan = FastMath.toRadians(220.); double alfa = FastMath.toRadians(5.300); iniDate = new AbsoluteDate(1970, 04, 07, 0, 0, 0.0, TimeScalesFactory.getUTC()); eme2000 = FramesFactory.getEME2000(); Orbit orbit = new CircularOrbit(a, ex, ey, i, raan, alfa, PositionAngle.MEAN, eme2000, iniDate, mu); // Target pointing attitude provider over satellite nadir at date with yaw compensation double ae = 6378137.0; double f = 1.0 / 298.257223563; Frame itrf2005 = FramesFactory.getITRF(IERSConventions.IERS_2010, true); BodyShape earth = new OneAxisEllipsoid(ae, f, itrf2005); sun = CelestialBodyFactory.getSun(); AttitudeProvider attitudeLaw = new YawSteering(new NadirPointing(earth), sun, Vector3D.MINUS_I); // Propagator : Eckstein-Hechler analytic propagator double c20 = -1.08263e-3; double c30 = 2.54e-6; double c40 = 1.62e-6; double c50 = 2.3e-7; double c60 = -5.5e-7; Propagator propagator = new EcksteinHechlerPropagator(orbit, attitudeLaw, ae, mu, c20, c30, c40, c50, c60); // The spacecraft frame is associated with the propagator. scFrame = new SpacecraftFrame(propagator, "Spacecraft"); } catch (OrekitException oe) { Assert.fail(oe.getLocalizedMessage()); } }
From source file:org.orekit.frames.TransformTest.java
@Test public void testRoughTransPV() { PVCoordinates pointP1 = new PVCoordinates(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.PLUS_I); // translation transform test PVCoordinates pointP2 = new PVCoordinates(new Vector3D(0, 0, 0), new Vector3D(0, 0, 0)); Transform R1toR2 = new Transform(AbsoluteDate.J2000_EPOCH, Vector3D.MINUS_I, Vector3D.MINUS_I, Vector3D.MINUS_I);/*from ww w . j ava2s .c om*/ PVCoordinates result1 = R1toR2.transformPVCoordinates(pointP1); checkVector(pointP2.getPosition(), result1.getPosition(), 1.0e-15); checkVector(pointP2.getVelocity(), result1.getVelocity(), 1.0e-15); checkVector(pointP2.getAcceleration(), result1.getAcceleration(), 1.0e-15); // test inverse translation Transform R2toR1 = R1toR2.getInverse(); PVCoordinates invResult1 = R2toR1.transformPVCoordinates(pointP2); checkVector(pointP1.getPosition(), invResult1.getPosition(), 1.0e-15); checkVector(pointP1.getVelocity(), invResult1.getVelocity(), 1.0e-15); checkVector(pointP1.getAcceleration(), invResult1.getAcceleration(), 1.0e-15); // rotation transform test PVCoordinates pointP3 = new PVCoordinates(Vector3D.PLUS_J, new Vector3D(-2, 1, 0), new Vector3D(-4, -3, -1)); Rotation R = new Rotation(Vector3D.PLUS_K, FastMath.PI / 2); Transform R1toR3 = new Transform(AbsoluteDate.J2000_EPOCH, R, new Vector3D(0, 0, -2), new Vector3D(1, 0, 0)); PVCoordinates result2 = R1toR3.transformPVCoordinates(pointP1); checkVector(pointP3.getPosition(), result2.getPosition(), 1.0e-15); checkVector(pointP3.getVelocity(), result2.getVelocity(), 1.0e-15); checkVector(pointP3.getAcceleration(), result2.getAcceleration(), 1.0e-15); // test inverse rotation Transform R3toR1 = R1toR3.getInverse(); PVCoordinates invResult2 = R3toR1.transformPVCoordinates(pointP3); checkVector(pointP1.getPosition(), invResult2.getPosition(), 1.0e-15); checkVector(pointP1.getVelocity(), invResult2.getVelocity(), 1.0e-15); checkVector(pointP1.getAcceleration(), invResult2.getAcceleration(), 1.0e-15); // combine 2 velocity transform Transform R1toR4 = new Transform(AbsoluteDate.J2000_EPOCH, new Vector3D(-2, 0, 0), new Vector3D(-2, 0, 0), new Vector3D(-2, 0, 0)); PVCoordinates pointP4 = new PVCoordinates(new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 0)); Transform R2toR4 = new Transform(AbsoluteDate.J2000_EPOCH, R2toR1, R1toR4); PVCoordinates compResult = R2toR4.transformPVCoordinates(pointP2); checkVector(pointP4.getPosition(), compResult.getPosition(), 1.0e-15); checkVector(pointP4.getVelocity(), compResult.getVelocity(), 1.0e-15); checkVector(pointP4.getAcceleration(), compResult.getAcceleration(), 1.0e-15); // combine 2 rotation tranform PVCoordinates pointP5 = new PVCoordinates(new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 3), new Vector3D(8, 0, 6)); Rotation R2 = new Rotation(new Vector3D(0, 0, 1), FastMath.PI); Transform R1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R2, new Vector3D(0, -3, 0)); Transform R3toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR5); PVCoordinates combResult = R3toR5.transformPVCoordinates(pointP3); checkVector(pointP5.getPosition(), combResult.getPosition(), 1.0e-15); checkVector(pointP5.getVelocity(), combResult.getVelocity(), 1.0e-15); checkVector(pointP5.getAcceleration(), combResult.getAcceleration(), 1.0e-15); // combine translation and rotation Transform R2toR3 = new Transform(AbsoluteDate.J2000_EPOCH, R2toR1, R1toR3); PVCoordinates result = R2toR3.transformPVCoordinates(pointP2); checkVector(pointP3.getPosition(), result.getPosition(), 1.0e-15); checkVector(pointP3.getVelocity(), result.getVelocity(), 1.0e-15); checkVector(pointP3.getAcceleration(), result.getAcceleration(), 1.0e-15); Transform R3toR2 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR2); result = R3toR2.transformPVCoordinates(pointP3); checkVector(pointP2.getPosition(), result.getPosition(), 1.0e-15); checkVector(pointP2.getVelocity(), result.getVelocity(), 1.0e-15); checkVector(pointP2.getAcceleration(), result.getAcceleration(), 1.0e-15); Transform newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR2, R2toR3); newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R3toR5); result = newR1toR5.transformPVCoordinates(pointP1); checkVector(pointP5.getPosition(), result.getPosition(), 1.0e-15); checkVector(pointP5.getVelocity(), result.getVelocity(), 1.0e-15); checkVector(pointP5.getAcceleration(), result.getAcceleration(), 1.0e-15); // more tests newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR2, R2toR3); Transform R3toR4 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR4); newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R3toR4); Transform R4toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR4.getInverse(), R1toR5); newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R4toR5); result = newR1toR5.transformPVCoordinates(pointP1); checkVector(pointP5.getPosition(), result.getPosition(), 1.0e-15); checkVector(pointP5.getVelocity(), result.getVelocity(), 1.0e-15); checkVector(pointP5.getAcceleration(), result.getAcceleration(), 1.0e-15); }
From source file:org.orekit.frames.TransformTest.java
@Test public void testShift() { // the following transform corresponds to a frame moving along the line x=1 and rotating around its -z axis // the linear motion velocity is (0, +1, 0), the angular rate is PI/2 // at t = -1 the frame origin is at (1, -1, 0), its X axis is equal to Xref and its Y axis is equal to Yref // at t = 0 the frame origin is at (1, 0, 0), its X axis is equal to -Yref and its Y axis is equal to Xref // at t = +1 the frame origin is at (1, +1, 0), its X axis is equal to -Xref and its Y axis is equal to -Yref AbsoluteDate date = AbsoluteDate.GALILEO_EPOCH; double alpha0 = 0.5 * FastMath.PI; double omega = 0.5 * FastMath.PI; Transform t = new Transform(date, new Transform(date, Vector3D.MINUS_I, Vector3D.MINUS_J, Vector3D.ZERO), new Transform(date, new Rotation(Vector3D.PLUS_K, alpha0), new Vector3D(omega, Vector3D.MINUS_K))); for (double dt = -10.0; dt < 10.0; dt += 0.125) { Transform shifted = t.shiftedBy(dt); // the following point should always remain at moving frame origin PVCoordinates expectedFixedPoint = shifted.transformPVCoordinates( new PVCoordinates(new Vector3D(1, dt, 0), Vector3D.PLUS_J, Vector3D.ZERO)); checkVector(expectedFixedPoint.getPosition(), Vector3D.ZERO, 1.0e-14); checkVector(expectedFixedPoint.getVelocity(), Vector3D.ZERO, 1.0e-14); checkVector(expectedFixedPoint.getAcceleration(), Vector3D.ZERO, 1.0e-14); // fixed frame origin apparent motion in moving frame PVCoordinates expectedApparentMotion = shifted.transformPVCoordinates(PVCoordinates.ZERO); double c = FastMath.cos(alpha0 + omega * dt); double s = FastMath.sin(alpha0 + omega * dt); Vector3D referencePosition = new Vector3D(-c + dt * s, -s - dt * c, 0); Vector3D referenceVelocity = new Vector3D((1 + omega) * s + dt * omega * c, -(1 + omega) * c + dt * omega * s, 0); Vector3D referenceAcceleration = new Vector3D(omega * (2 + omega) * c - dt * omega * omega * s, omega * (2 + omega) * s + dt * omega * omega * c, 0); checkVector(expectedApparentMotion.getPosition(), referencePosition, 1.0e-14); checkVector(expectedApparentMotion.getVelocity(), referenceVelocity, 1.0e-14); checkVector(expectedApparentMotion.getAcceleration(), referenceAcceleration, 1.0e-14); }/* w w w .j a va 2s .c o m*/ }
From source file:org.orekit.utils.AngularCoordinatesTest.java
@Test public void testInverseCrossProductsFailures() { checkInverseFailure(Vector3D.PLUS_K, Vector3D.ZERO, Vector3D.PLUS_J, Vector3D.PLUS_I, Vector3D.PLUS_K); checkInverseFailure(Vector3D.PLUS_K, Vector3D.ZERO, Vector3D.ZERO, Vector3D.ZERO, Vector3D.PLUS_K); checkInverseFailure(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.ZERO, Vector3D.MINUS_I, Vector3D.PLUS_K); checkInverseFailure(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.ZERO, Vector3D.PLUS_J, Vector3D.PLUS_J); checkInverseFailure(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.PLUS_J, Vector3D.PLUS_J, Vector3D.ZERO); checkInverseFailure(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.PLUS_J, Vector3D.ZERO, Vector3D.PLUS_J); }
From source file:org.orekit.utils.PVCoordinatesTest.java
@Test public void testGetMomentum() { //setup/* w ww. j a v a 2 s. c o m*/ Vector3D p = new Vector3D(1, -2, 3); Vector3D v = new Vector3D(-9, 8, -7); //action + verify Assert.assertEquals(new PVCoordinates(p, v).getMomentum(), p.crossProduct(v)); //check simple cases Assert.assertEquals(new PVCoordinates(Vector3D.PLUS_I, Vector3D.MINUS_I).getMomentum(), Vector3D.ZERO); Assert.assertEquals(new PVCoordinates(Vector3D.PLUS_I, Vector3D.PLUS_J).getMomentum(), Vector3D.PLUS_K); }
From source file:org.orekit.utils.PVCoordinatesTest.java
@Test public void testGetAngularVelocity() { //setup//from ww w . j a v a2s .c om Vector3D p = new Vector3D(1, -2, 3); Vector3D v = new Vector3D(-9, 8, -7); //action + verify Assert.assertEquals(new PVCoordinates(p, v).getAngularVelocity(), p.crossProduct(v).scalarMultiply(1.0 / p.getNormSq())); //check extra simple cases Assert.assertEquals(new PVCoordinates(Vector3D.PLUS_I, Vector3D.MINUS_I).getAngularVelocity(), Vector3D.ZERO); Assert.assertEquals(new PVCoordinates(new Vector3D(2, 0, 0), Vector3D.PLUS_J).getAngularVelocity(), Vector3D.PLUS_K.scalarMultiply(0.5)); }