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)));
}
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);
}
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)));
}
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());
}
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);
}
Aggregations