1 /* Copyright 2002-2025 CS GROUP
2 * Licensed to CS GROUP (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
19 import org.orekit.errors.OrekitIllegalArgumentException;
20 import org.orekit.errors.OrekitMessages;
21 import org.orekit.time.AbsoluteDate;
22 import org.orekit.time.FieldAbsoluteDate;
23
24 /** Enumerate for selecting which derivatives to use in {@link TimeStampedAngularCoordinates}
25 * and {@link TimeStampedFieldAngularCoordinates} interpolation.
26 * @see TimeStampedAngularCoordinatesHermiteInterpolator#interpolate(AbsoluteDate, java.util.Collection)
27 * @see TimeStampedFieldAngularCoordinatesHermiteInterpolator#interpolate(FieldAbsoluteDate, java.util.Collection)
28 * @see CartesianDerivativesFilter
29 * @author Luc Maisonobe
30 * @since 7.0
31 */
32 public enum AngularDerivativesFilter {
33
34 /** Use only rotations, ignoring rotation rates. */
35 USE_R(0),
36
37 /** Use rotations and rotation rates. */
38 USE_RR(1),
39
40 /** Use rotations, rotation rates and acceleration. */
41 USE_RRA(2);
42
43 /** Maximum derivation order. */
44 private final int maxOrder;
45
46 /** Simple constructor.
47 * @param maxOrder maximum derivation order
48 */
49 AngularDerivativesFilter(final int maxOrder) {
50 this.maxOrder = maxOrder;
51 }
52
53 /** Get the maximum derivation order.
54 * @return maximum derivation order
55 */
56 public int getMaxOrder() {
57 return maxOrder;
58 }
59
60 /** Get the filter corresponding to a maximum derivation order.
61 * @param order maximum derivation order
62 * @return the filter corresponding to derivation order
63 * @exception IllegalArgumentException if the order is out of range
64 */
65 public static AngularDerivativesFilter getFilter(final int order)
66 throws IllegalArgumentException {
67 for (final AngularDerivativesFilter filter : values()) {
68 if (filter.getMaxOrder() == order) {
69 return filter;
70 }
71 }
72 throw new OrekitIllegalArgumentException(OrekitMessages.OUT_OF_RANGE_DERIVATION_ORDER, order);
73 }
74
75 }