TimeStampedFieldAngularCoordinates.java

  1. /* Copyright 2002-2019 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.utils;

  18. import java.util.Collection;

  19. import org.hipparchus.Field;
  20. import org.hipparchus.RealFieldElement;
  21. import org.hipparchus.analysis.differentiation.FieldDerivativeStructure;
  22. import org.hipparchus.analysis.interpolation.FieldHermiteInterpolator;
  23. import org.hipparchus.geometry.euclidean.threed.FieldRotation;
  24. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  25. import org.hipparchus.geometry.euclidean.threed.RotationConvention;
  26. import org.hipparchus.util.FastMath;
  27. import org.orekit.errors.OrekitException;
  28. import org.orekit.errors.OrekitInternalError;
  29. import org.orekit.errors.OrekitMessages;
  30. import org.orekit.time.AbsoluteDate;
  31. import org.orekit.time.FieldAbsoluteDate;
  32. import org.orekit.time.TimeStamped;

  33. /** {@link TimeStamped time-stamped} version of {@link FieldAngularCoordinates}.
  34.  * <p>Instances of this class are guaranteed to be immutable.</p>
  35.  * @param <T> the type of the field elements
  36.  * @author Luc Maisonobe
  37.  * @since 7.0
  38.  */
  39. public class TimeStampedFieldAngularCoordinates<T extends RealFieldElement<T>>
  40.     extends FieldAngularCoordinates<T> {

  41.     /** The date. */
  42.     private final FieldAbsoluteDate<T> date;

  43.     /** Build the rotation that transforms a pair of pv coordinates into another pair.

  44.      * <p><em>WARNING</em>! This method requires much more stringent assumptions on
  45.      * its parameters than the similar {@link org.hipparchus.geometry.euclidean.threed.Rotation#Rotation(
  46.      * org.hipparchus.geometry.euclidean.threed.Vector3D, org.hipparchus.geometry.euclidean.threed.Vector3D,
  47.      * org.hipparchus.geometry.euclidean.threed.Vector3D, org.hipparchus.geometry.euclidean.threed.Vector3D)
  48.      * constructor} from the {@link org.hipparchus.geometry.euclidean.threed.Rotation Rotation} class.
  49.      * As far as the Rotation constructor is concerned, the {@code v₂} vector from
  50.      * the second pair can be slightly misaligned. The Rotation constructor will
  51.      * compensate for this misalignment and create a rotation that ensure {@code
  52.      * v₁ = r(u₁)} and {@code v₂ ∈ plane (r(u₁), r(u₂))}. <em>THIS IS NOT
  53.      * TRUE ANYMORE IN THIS CLASS</em>! As derivatives are involved and must be
  54.      * preserved, this constructor works <em>only</em> if the two pairs are fully
  55.      * consistent, i.e. if a rotation exists that fulfill all the requirements: {@code
  56.      * v₁ = r(u₁)}, {@code v₂ = r(u₂)}, {@code dv₁/dt = dr(u₁)/dt}, {@code dv₂/dt
  57.      * = dr(u₂)/dt}, {@code d²v₁/dt² = d²r(u₁)/dt²}, {@code d²v₂/dt² = d²r(u₂)/dt²}.</p>

  58.      * @param date coordinates date
  59.      * @param u1 first vector of the origin pair
  60.      * @param u2 second vector of the origin pair
  61.      * @param v1 desired image of u1 by the rotation
  62.      * @param v2 desired image of u2 by the rotation
  63.      * @param tolerance relative tolerance factor used to check singularities
  64.      */
  65.     public TimeStampedFieldAngularCoordinates (final AbsoluteDate date,
  66.                                                final FieldPVCoordinates<T> u1, final FieldPVCoordinates<T> u2,
  67.                                                final FieldPVCoordinates<T> v1, final FieldPVCoordinates<T> v2,
  68.                                                final double tolerance) {
  69.         this(new FieldAbsoluteDate<>(u1.getPosition().getX().getField(), date),
  70.              u1, u2, v1, v2, tolerance);
  71.     }

  72.     /** Build the rotation that transforms a pair of pv coordinates into another pair.

  73.      * <p><em>WARNING</em>! This method requires much more stringent assumptions on
  74.      * its parameters than the similar {@link org.hipparchus.geometry.euclidean.threed.Rotation#Rotation(
  75.      * org.hipparchus.geometry.euclidean.threed.Vector3D, org.hipparchus.geometry.euclidean.threed.Vector3D,
  76.      * org.hipparchus.geometry.euclidean.threed.Vector3D, org.hipparchus.geometry.euclidean.threed.Vector3D)
  77.      * constructor} from the {@link org.hipparchus.geometry.euclidean.threed.Rotation Rotation} class.
  78.      * As far as the Rotation constructor is concerned, the {@code v₂} vector from
  79.      * the second pair can be slightly misaligned. The Rotation constructor will
  80.      * compensate for this misalignment and create a rotation that ensure {@code
  81.      * v₁ = r(u₁)} and {@code v₂ ∈ plane (r(u₁), r(u₂))}. <em>THIS IS NOT
  82.      * TRUE ANYMORE IN THIS CLASS</em>! As derivatives are involved and must be
  83.      * preserved, this constructor works <em>only</em> if the two pairs are fully
  84.      * consistent, i.e. if a rotation exists that fulfill all the requirements: {@code
  85.      * v₁ = r(u₁)}, {@code v₂ = r(u₂)}, {@code dv₁/dt = dr(u₁)/dt}, {@code dv₂/dt
  86.      * = dr(u₂)/dt}, {@code d²v₁/dt² = d²r(u₁)/dt²}, {@code d²v₂/dt² = d²r(u₂)/dt²}.</p>

  87.      * @param date coordinates date
  88.      * @param u1 first vector of the origin pair
  89.      * @param u2 second vector of the origin pair
  90.      * @param v1 desired image of u1 by the rotation
  91.      * @param v2 desired image of u2 by the rotation
  92.      * @param tolerance relative tolerance factor used to check singularities
  93.      */
  94.     public TimeStampedFieldAngularCoordinates (final FieldAbsoluteDate<T> date,
  95.                                                final FieldPVCoordinates<T> u1, final FieldPVCoordinates<T> u2,
  96.                                                final FieldPVCoordinates<T> v1, final FieldPVCoordinates<T> v2,
  97.                                                final double tolerance) {
  98.         super(u1, u2, v1, v2, tolerance);
  99.         this.date = date;
  100.     }

  101.     /** Builds a rotation/rotation rate pair.
  102.      * @param date coordinates date
  103.      * @param rotation rotation
  104.      * @param rotationRate rotation rate Ω (rad/s)
  105.      * @param rotationAcceleration rotation acceleration dΩ/dt (rad²/s²)
  106.      */
  107.     public TimeStampedFieldAngularCoordinates(final AbsoluteDate date,
  108.                                               final FieldRotation<T> rotation,
  109.                                               final FieldVector3D<T> rotationRate,
  110.                                               final FieldVector3D<T> rotationAcceleration) {
  111.         this(new FieldAbsoluteDate<>(rotation.getQ0().getField(), date),
  112.              rotation, rotationRate, rotationAcceleration);
  113.     }

  114.     /** Builds a rotation/rotation rate pair.
  115.      * @param date coordinates date
  116.      * @param rotation rotation
  117.      * @param rotationRate rotation rate Ω (rad/s)
  118.      * @param rotationAcceleration rotation acceleration dΩ/dt (rad²/s²)
  119.      */
  120.     public TimeStampedFieldAngularCoordinates(final FieldAbsoluteDate<T> date,
  121.                                               final FieldRotation<T> rotation,
  122.                                               final FieldVector3D<T> rotationRate,
  123.                                               final FieldVector3D<T> rotationAcceleration) {
  124.         super(rotation, rotationRate, rotationAcceleration);
  125.         this.date = date;
  126.     }

  127.     /** Builds an instance for a regular {@link TimeStampedAngularCoordinates}.
  128.      * @param field fields to which the elements belong
  129.      * @param ac coordinates to convert
  130.      * @since 9.0
  131.      */
  132.     public TimeStampedFieldAngularCoordinates(final Field<T> field,
  133.                                               final TimeStampedAngularCoordinates ac) {
  134.         this(new FieldAbsoluteDate<>(field, ac.getDate()),
  135.              new FieldRotation<>(field, ac.getRotation()),
  136.              new FieldVector3D<>(field, ac.getRotationRate()),
  137.              new FieldVector3D<>(field, ac.getRotationAcceleration()));
  138.     }

  139.     /** Builds a TimeStampedFieldAngularCoordinates from  a {@link FieldRotation}&lt;{@link FieldDerivativeStructure}&gt;.
  140.      * <p>
  141.      * The rotation components must have time as their only derivation parameter and
  142.      * have consistent derivation orders.
  143.      * </p>
  144.      * @param date coordinates date
  145.      * @param r rotation with time-derivatives embedded within the coordinates
  146.      * @since 9.2
  147.      */
  148.     public TimeStampedFieldAngularCoordinates(final FieldAbsoluteDate<T> date,
  149.                                               final FieldRotation<FieldDerivativeStructure<T>> r) {
  150.         super(r);
  151.         this.date = date;
  152.     }

  153.     /** Revert a rotation/rotation rate pair.
  154.      * Build a pair which reverse the effect of another pair.
  155.      * @return a new pair whose effect is the reverse of the effect
  156.      * of the instance
  157.      */
  158.     public TimeStampedFieldAngularCoordinates<T> revert() {
  159.         return new TimeStampedFieldAngularCoordinates<>(date,
  160.                                                         getRotation().revert(),
  161.                                                         getRotation().applyInverseTo(getRotationRate().negate()),
  162.                                                         getRotation().applyInverseTo(getRotationAcceleration().negate()));
  163.     }

  164.     /** Get the date.
  165.      * @return date
  166.      */
  167.     public FieldAbsoluteDate<T> getDate() {
  168.         return date;
  169.     }

  170.     /** Get a time-shifted state.
  171.      * <p>
  172.      * The state can be slightly shifted to close dates. This shift is based on
  173.      * a simple linear model. It is <em>not</em> intended as a replacement for
  174.      * proper attitude propagation but should be sufficient for either small
  175.      * time shifts or coarse accuracy.
  176.      * </p>
  177.      * @param dt time shift in seconds
  178.      * @return a new state, shifted with respect to the instance (which is immutable)
  179.      */
  180.     public TimeStampedFieldAngularCoordinates<T> shiftedBy(final double dt) {
  181.         return shiftedBy(getDate().getField().getZero().add(dt));
  182.     }

  183.     /** Get a time-shifted state.
  184.      * <p>
  185.      * The state can be slightly shifted to close dates. This shift is based on
  186.      * a simple linear model. It is <em>not</em> intended as a replacement for
  187.      * proper attitude propagation but should be sufficient for either small
  188.      * time shifts or coarse accuracy.
  189.      * </p>
  190.      * @param dt time shift in seconds
  191.      * @return a new state, shifted with respect to the instance (which is immutable)
  192.      */
  193.     public TimeStampedFieldAngularCoordinates<T> shiftedBy(final T dt) {
  194.         final FieldAngularCoordinates<T> sac = super.shiftedBy(dt);
  195.         return new TimeStampedFieldAngularCoordinates<>(date.shiftedBy(dt),
  196.                                                         sac.getRotation(), sac.getRotationRate(), sac.getRotationAcceleration());

  197.     }

  198.     /** Add an offset from the instance.
  199.      * <p>
  200.      * We consider here that the offset rotation is applied first and the
  201.      * instance is applied afterward. Note that angular coordinates do <em>not</em>
  202.      * commute under this operation, i.e. {@code a.addOffset(b)} and {@code
  203.      * b.addOffset(a)} lead to <em>different</em> results in most cases.
  204.      * </p>
  205.      * <p>
  206.      * The two methods {@link #addOffset(FieldAngularCoordinates) addOffset} and
  207.      * {@link #subtractOffset(FieldAngularCoordinates) subtractOffset} are designed
  208.      * so that round trip applications are possible. This means that both {@code
  209.      * ac1.subtractOffset(ac2).addOffset(ac2)} and {@code
  210.      * ac1.addOffset(ac2).subtractOffset(ac2)} return angular coordinates equal to ac1.
  211.      * </p>
  212.      * @param offset offset to subtract
  213.      * @return new instance, with offset subtracted
  214.      * @see #subtractOffset(FieldAngularCoordinates)
  215.      */
  216.     public TimeStampedFieldAngularCoordinates<T> addOffset(final FieldAngularCoordinates<T> offset) {
  217.         final FieldVector3D<T> rOmega    = getRotation().applyTo(offset.getRotationRate());
  218.         final FieldVector3D<T> rOmegaDot = getRotation().applyTo(offset.getRotationAcceleration());
  219.         return new TimeStampedFieldAngularCoordinates<>(date,
  220.                                                         getRotation().compose(offset.getRotation(), RotationConvention.VECTOR_OPERATOR),
  221.                                                         getRotationRate().add(rOmega),
  222.                                                         new FieldVector3D<>( 1.0, getRotationAcceleration(),
  223.                                                                               1.0, rOmegaDot,
  224.                                                                              -1.0, FieldVector3D.crossProduct(getRotationRate(), rOmega)));
  225.     }

  226.     /** Subtract an offset from the instance.
  227.      * <p>
  228.      * We consider here that the offset Rotation is applied first and the
  229.      * instance is applied afterward. Note that angular coordinates do <em>not</em>
  230.      * commute under this operation, i.e. {@code a.subtractOffset(b)} and {@code
  231.      * b.subtractOffset(a)} lead to <em>different</em> results in most cases.
  232.      * </p>
  233.      * <p>
  234.      * The two methods {@link #addOffset(FieldAngularCoordinates) addOffset} and
  235.      * {@link #subtractOffset(FieldAngularCoordinates) subtractOffset} are designed
  236.      * so that round trip applications are possible. This means that both {@code
  237.      * ac1.subtractOffset(ac2).addOffset(ac2)} and {@code
  238.      * ac1.addOffset(ac2).subtractOffset(ac2)} return angular coordinates equal to ac1.
  239.      * </p>
  240.      * @param offset offset to subtract
  241.      * @return new instance, with offset subtracted
  242.      * @see #addOffset(FieldAngularCoordinates)
  243.      */
  244.     public TimeStampedFieldAngularCoordinates<T> subtractOffset(final FieldAngularCoordinates<T> offset) {
  245.         return addOffset(offset.revert());
  246.     }

  247.     /** Interpolate angular coordinates.
  248.      * <p>
  249.      * The interpolated instance is created by polynomial Hermite interpolation
  250.      * on Rodrigues vector ensuring rotation rate remains the exact derivative of rotation.
  251.      * </p>
  252.      * <p>
  253.      * This method is based on Sergei Tanygin's paper <a
  254.      * href="http://www.agi.com/downloads/resources/white-papers/Attitude-interpolation.pdf">Attitude
  255.      * Interpolation</a>, changing the norm of the vector to match the modified Rodrigues
  256.      * vector as described in Malcolm D. Shuster's paper <a
  257.      * href="http://www.ladispe.polito.it/corsi/Meccatronica/02JHCOR/2011-12/Slides/Shuster_Pub_1993h_J_Repsurv_scan.pdf">A
  258.      * Survey of Attitude Representations</a>. This change avoids the singularity at π.
  259.      * There is still a singularity at 2π, which is handled by slightly offsetting all rotations
  260.      * when this singularity is detected.
  261.      * </p>
  262.      * <p>
  263.      * Note that even if first time derivatives (rotation rates)
  264.      * from sample can be ignored, the interpolated instance always includes
  265.      * interpolated derivatives. This feature can be used explicitly to
  266.      * compute these derivatives when it would be too complex to compute them
  267.      * from an analytical formula: just compute a few sample points from the
  268.      * explicit formula and set the derivatives to zero in these sample points,
  269.      * then use interpolation to add derivatives consistent with the rotations.
  270.      * </p>
  271.      * @param date interpolation date
  272.      * @param filter filter for derivatives from the sample to use in interpolation
  273.      * @param sample sample points on which interpolation should be done
  274.      * @param <T> the type of the field elements
  275.      * @return a new position-velocity, interpolated at specified date
  276.      */
  277.     public static <T extends RealFieldElement<T>>
  278.         TimeStampedFieldAngularCoordinates<T> interpolate(final AbsoluteDate date,
  279.                                                           final AngularDerivativesFilter filter,
  280.                                                           final Collection<TimeStampedFieldAngularCoordinates<T>> sample) {
  281.         return interpolate(new FieldAbsoluteDate<>(sample.iterator().next().getRotation().getQ0().getField(), date),
  282.                            filter, sample);
  283.     }

  284.     /** Interpolate angular coordinates.
  285.      * <p>
  286.      * The interpolated instance is created by polynomial Hermite interpolation
  287.      * on Rodrigues vector ensuring rotation rate remains the exact derivative of rotation.
  288.      * </p>
  289.      * <p>
  290.      * This method is based on Sergei Tanygin's paper <a
  291.      * href="http://www.agi.com/downloads/resources/white-papers/Attitude-interpolation.pdf">Attitude
  292.      * Interpolation</a>, changing the norm of the vector to match the modified Rodrigues
  293.      * vector as described in Malcolm D. Shuster's paper <a
  294.      * href="http://www.ladispe.polito.it/corsi/Meccatronica/02JHCOR/2011-12/Slides/Shuster_Pub_1993h_J_Repsurv_scan.pdf">A
  295.      * Survey of Attitude Representations</a>. This change avoids the singularity at π.
  296.      * There is still a singularity at 2π, which is handled by slightly offsetting all rotations
  297.      * when this singularity is detected.
  298.      * </p>
  299.      * <p>
  300.      * Note that even if first time derivatives (rotation rates)
  301.      * from sample can be ignored, the interpolated instance always includes
  302.      * interpolated derivatives. This feature can be used explicitly to
  303.      * compute these derivatives when it would be too complex to compute them
  304.      * from an analytical formula: just compute a few sample points from the
  305.      * explicit formula and set the derivatives to zero in these sample points,
  306.      * then use interpolation to add derivatives consistent with the rotations.
  307.      * </p>
  308.      * @param date interpolation date
  309.      * @param filter filter for derivatives from the sample to use in interpolation
  310.      * @param sample sample points on which interpolation should be done
  311.      * @param <T> the type of the field elements
  312.      * @return a new position-velocity, interpolated at specified date
  313.      */
  314.     public static <T extends RealFieldElement<T>>
  315.         TimeStampedFieldAngularCoordinates<T> interpolate(final FieldAbsoluteDate<T> date,
  316.                                                           final AngularDerivativesFilter filter,
  317.                                                           final Collection<TimeStampedFieldAngularCoordinates<T>> sample) {

  318.         // get field properties
  319.         final Field<T> field = sample.iterator().next().getRotation().getQ0().getField();

  320.         // set up safety elements for 2π singularity avoidance
  321.         final double epsilon   = 2 * FastMath.PI / sample.size();
  322.         final double threshold = FastMath.min(-(1.0 - 1.0e-4), -FastMath.cos(epsilon / 4));

  323.         // set up a linear model canceling mean rotation rate
  324.         final FieldVector3D<T> meanRate;
  325.         if (filter != AngularDerivativesFilter.USE_R) {
  326.             FieldVector3D<T> sum = FieldVector3D.getZero(field);
  327.             for (final TimeStampedFieldAngularCoordinates<T> datedAC : sample) {
  328.                 sum = sum.add(datedAC.getRotationRate());
  329.             }
  330.             meanRate = new FieldVector3D<>(1.0 / sample.size(), sum);
  331.         } else {
  332.             if (sample.size() < 2) {
  333.                 throw new OrekitException(OrekitMessages.NOT_ENOUGH_DATA_FOR_INTERPOLATION,
  334.                                           sample.size());
  335.             }
  336.             FieldVector3D<T> sum = FieldVector3D.getZero(field);
  337.             TimeStampedFieldAngularCoordinates<T> previous = null;
  338.             for (final TimeStampedFieldAngularCoordinates<T> datedAC : sample) {
  339.                 if (previous != null) {
  340.                     sum = sum.add(estimateRate(previous.getRotation(), datedAC.getRotation(),
  341.                                                datedAC.date.durationFrom(previous.getDate())));
  342.                 }
  343.                 previous = datedAC;
  344.             }
  345.             meanRate = new FieldVector3D<>(1.0 / (sample.size() - 1), sum);
  346.         }
  347.         TimeStampedFieldAngularCoordinates<T> offset =
  348.                 new TimeStampedFieldAngularCoordinates<>(date, FieldRotation.getIdentity(field),
  349.                                                          meanRate, FieldVector3D.getZero(field));

  350.         boolean restart = true;
  351.         for (int i = 0; restart && i < sample.size() + 2; ++i) {

  352.             // offset adaptation parameters
  353.             restart = false;

  354.             // set up an interpolator taking derivatives into account
  355.             final FieldHermiteInterpolator<T> interpolator = new FieldHermiteInterpolator<>();

  356.             // add sample points
  357.             double sign = +1.0;
  358.             FieldRotation<T> previous = FieldRotation.getIdentity(field);

  359.             for (final TimeStampedFieldAngularCoordinates<T> ac : sample) {

  360.                 // remove linear offset from the current coordinates
  361.                 final T dt = ac.date.durationFrom(date);
  362.                 final TimeStampedFieldAngularCoordinates<T> fixed = ac.subtractOffset(offset.shiftedBy(dt));

  363.                 // make sure all interpolated points will be on the same branch
  364.                 final T dot = dt.linearCombination(fixed.getRotation().getQ0(), previous.getQ0(),
  365.                                                    fixed.getRotation().getQ1(), previous.getQ1(),
  366.                                                    fixed.getRotation().getQ2(), previous.getQ2(),
  367.                                                    fixed.getRotation().getQ3(), previous.getQ3());
  368.                 sign = FastMath.copySign(1.0, dot.getReal() * sign);
  369.                 previous = fixed.getRotation();

  370.                 // check modified Rodrigues vector singularity
  371.                 if (fixed.getRotation().getQ0().getReal() * sign < threshold) {
  372.                     // the sample point is close to a modified Rodrigues vector singularity
  373.                     // we need to change the linear offset model to avoid this
  374.                     restart = true;
  375.                     break;
  376.                 }

  377.                 final T[][] rodrigues = fixed.getModifiedRodrigues(sign);
  378.                 switch (filter) {
  379.                     case USE_RRA:
  380.                         // populate sample with rotation, rotation rate and acceleration data
  381.                         interpolator.addSamplePoint(dt, rodrigues[0], rodrigues[1], rodrigues[2]);
  382.                         break;
  383.                     case USE_RR:
  384.                         // populate sample with rotation and rotation rate data
  385.                         interpolator.addSamplePoint(dt, rodrigues[0], rodrigues[1]);
  386.                         break;
  387.                     case USE_R:
  388.                         // populate sample with rotation data only
  389.                         interpolator.addSamplePoint(dt, rodrigues[0]);
  390.                         break;
  391.                     default :
  392.                         // this should never happen
  393.                         throw new OrekitInternalError(null);
  394.                 }
  395.             }

  396.             if (restart) {
  397.                 // interpolation failed, some intermediate rotation was too close to 2π
  398.                 // we need to offset all rotations to avoid the singularity
  399.                 offset = offset.addOffset(new FieldAngularCoordinates<>(new FieldRotation<>(FieldVector3D.getPlusI(field),
  400.                                                                                             field.getZero().add(epsilon),
  401.                                                                                             RotationConvention.VECTOR_OPERATOR),
  402.                                                                         FieldVector3D.getZero(field),
  403.                                                                         FieldVector3D.getZero(field)));
  404.             } else {
  405.                 // interpolation succeeded with the current offset
  406.                 final T[][] p = interpolator.derivatives(field.getZero(), 2);
  407.                 final FieldAngularCoordinates<T> ac = createFromModifiedRodrigues(p);
  408.                 return new TimeStampedFieldAngularCoordinates<>(offset.getDate(),
  409.                                                                 ac.getRotation(),
  410.                                                                 ac.getRotationRate(),
  411.                                                                 ac.getRotationAcceleration()).addOffset(offset);
  412.             }

  413.         }

  414.         // this should never happen
  415.         throw new OrekitInternalError(null);

  416.     }

  417. }