Search in sources :

Example 81 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class Transform method compositeAcceleration.

/**
 * Compute a composite acceleration.
 * @param first first applied transform
 * @param second second applied transform
 * @return acceleration part of the composite transform
 */
private static Vector3D compositeAcceleration(final Transform first, final Transform second) {
    final Vector3D a1 = first.cartesian.getAcceleration();
    final Rotation r1 = first.angular.getRotation();
    final Vector3D o1 = first.angular.getRotationRate();
    final Vector3D oDot1 = first.angular.getRotationAcceleration();
    final Vector3D p2 = second.cartesian.getPosition();
    final Vector3D v2 = second.cartesian.getVelocity();
    final Vector3D a2 = second.cartesian.getAcceleration();
    final Vector3D crossCrossP = Vector3D.crossProduct(o1, Vector3D.crossProduct(o1, p2));
    final Vector3D crossV = Vector3D.crossProduct(o1, v2);
    final Vector3D crossDotP = Vector3D.crossProduct(oDot1, p2);
    return a1.add(r1.applyInverseTo(new Vector3D(1, a2, 2, crossV, 1, crossCrossP, 1, crossDotP)));
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Example 82 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class Transform method compositeRotation.

/**
 * Compute a composite rotation.
 * @param first first applied transform
 * @param second second applied transform
 * @return rotation part of the composite transform
 */
private static Rotation compositeRotation(final Transform first, final Transform second) {
    final Rotation r1 = first.angular.getRotation();
    final Rotation r2 = second.angular.getRotation();
    return r1.compose(r2, RotationConvention.FRAME_TRANSFORM);
}
Also used : FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Example 83 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class Transform method compositeVelocity.

/**
 * Compute a composite velocity.
 * @param first first applied transform
 * @param second second applied transform
 * @return velocity part of the composite transform
 */
private static Vector3D compositeVelocity(final Transform first, final Transform second) {
    final Vector3D v1 = first.cartesian.getVelocity();
    final Rotation r1 = first.angular.getRotation();
    final Vector3D o1 = first.angular.getRotationRate();
    final Vector3D p2 = second.cartesian.getPosition();
    final Vector3D v2 = second.cartesian.getVelocity();
    final Vector3D crossP = Vector3D.crossProduct(o1, p2);
    return v1.add(r1.applyInverseTo(v2.add(crossP)));
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Example 84 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class Transform method getInverse.

/**
 * Get the inverse transform of the instance.
 * @return inverse transform of the instance
 */
public Transform getInverse() {
    final Rotation r = angular.getRotation();
    final Vector3D o = angular.getRotationRate();
    final Vector3D oDot = angular.getRotationAcceleration();
    final Vector3D rp = r.applyTo(cartesian.getPosition());
    final Vector3D rv = r.applyTo(cartesian.getVelocity());
    final Vector3D ra = r.applyTo(cartesian.getAcceleration());
    final Vector3D pInv = rp.negate();
    final Vector3D crossP = Vector3D.crossProduct(o, rp);
    final Vector3D vInv = crossP.subtract(rv);
    final Vector3D crossV = Vector3D.crossProduct(o, rv);
    final Vector3D crossDotP = Vector3D.crossProduct(oDot, rp);
    final Vector3D crossCrossP = Vector3D.crossProduct(o, crossP);
    final Vector3D aInv = new Vector3D(-1, ra, 2, crossV, 1, crossDotP, -1, crossCrossP);
    return new Transform(date, new PVCoordinates(pInv, vInv, aInv), angular.revert());
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Example 85 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class HelmertTransformation method getTransform.

/**
 * {@inheritDoc}
 */
@Override
public Transform getTransform(final AbsoluteDate date) {
    // compute parameters evolution since reference epoch
    final double dt = date.durationFrom(epoch);
    final Vector3D dR = new Vector3D(1, rotationVector, dt, rotationRate);
    // build translation part
    final Transform translationTransform = new Transform(date, cartesian.shiftedBy(dt));
    // build rotation part
    final double angle = dR.getNorm();
    final Transform rotationTransform = new Transform(date, (angle < Precision.SAFE_MIN) ? Rotation.IDENTITY : new Rotation(dR, angle, RotationConvention.VECTOR_OPERATOR), rotationRate);
    // combine both parts
    return new Transform(date, translationTransform, rotationTransform);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Aggregations

Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)145 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)116 Test (org.junit.Test)100 AbsoluteDate (org.orekit.time.AbsoluteDate)55 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)53 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)43 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)38 PVCoordinates (org.orekit.utils.PVCoordinates)30 SpacecraftState (org.orekit.propagation.SpacecraftState)26 DateComponents (org.orekit.time.DateComponents)22 Frame (org.orekit.frames.Frame)21 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)21 RandomGenerator (org.hipparchus.random.RandomGenerator)19 Transform (org.orekit.frames.Transform)19 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)19 CircularOrbit (org.orekit.orbits.CircularOrbit)18 TimeComponents (org.orekit.time.TimeComponents)17 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)16 GeodeticPoint (org.orekit.bodies.GeodeticPoint)15 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)14