diff --git a/src/main/java/org/orekit/rugged/los/FixedRotation.java b/src/main/java/org/orekit/rugged/los/FixedRotation.java index 9d38cd34b923e003050c7bae80d8b1e25716ef7e..ab8af7ea6185fb3c4376c399724c44b9024a5f44 100644 --- a/src/main/java/org/orekit/rugged/los/FixedRotation.java +++ b/src/main/java/org/orekit/rugged/los/FixedRotation.java @@ -20,6 +20,7 @@ import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; import org.apache.commons.math3.geometry.euclidean.threed.FieldRotation; import org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; @@ -50,7 +51,7 @@ public class FixedRotation implements TimeIndependentLOSTransform { */ public FixedRotation(final ParameterType type, final Vector3D axis, final double angle) { this.type = type; - this.rotation = new Rotation(axis, angle); + this.rotation = new Rotation(axis, angle, RotationConvention.VECTOR_OPERATOR); this.rDS = null; } @@ -81,14 +82,14 @@ public class FixedRotation implements TimeIndependentLOSTransform { public void setEstimatedParameters(final double[] parameters, final int start, final int length) throws RuggedException { checkSlice(length); - final Vector3D axis = rotation.getAxis(); - rotation = new Rotation(axis, parameters[start]); + final Vector3D axis = rotation.getAxis(RotationConvention.VECTOR_OPERATOR); + rotation = new Rotation(axis, parameters[start], RotationConvention.VECTOR_OPERATOR); final FieldVector3D<DerivativeStructure> axisDS = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters.length, 1, axis.getX()), new DerivativeStructure(parameters.length, 1, axis.getY()), new DerivativeStructure(parameters.length, 1, axis.getZ())); final DerivativeStructure angleDS = new DerivativeStructure(parameters.length, 1, start, parameters[start]); - rDS = new FieldRotation<DerivativeStructure>(axisDS, angleDS); + rDS = new FieldRotation<DerivativeStructure>(axisDS, angleDS, RotationConvention.VECTOR_OPERATOR); } /** Check the number of parameters of an array slice. diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index 6437832e73c6335a88972be02b431ebd963dc19a..68899ada33806432683c9d1d18a8a153a28b4f64 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -21,6 +21,7 @@ import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; import org.apache.commons.math3.geometry.euclidean.threed.FieldRotation; import org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; @@ -153,7 +154,9 @@ public class PolynomialRotation implements LOSTransform { /** {@inheritDoc} */ @Override public Vector3D transformLOS(final int i, final Vector3D los, final AbsoluteDate date) { - return new Rotation(axis, angle.value(date.durationFrom(referenceDate))).applyTo(los); + return new Rotation(axis, + angle.value(date.durationFrom(referenceDate)), + RotationConvention.VECTOR_OPERATOR).applyTo(los); } /** {@inheritDoc} */ @@ -168,7 +171,9 @@ public class PolynomialRotation implements LOSTransform { alpha = alpha.multiply(t).add(angleDS[k]); } - return new FieldRotation<DerivativeStructure>(axisDS, alpha).applyTo(los); + return new FieldRotation<DerivativeStructure>(axisDS, + alpha, + RotationConvention.VECTOR_OPERATOR).applyTo(los); } diff --git a/src/test/java/org/orekit/rugged/TestUtils.java b/src/test/java/org/orekit/rugged/TestUtils.java index 2e31a38d4194fd9c4402c54021ac8bcef3a667cb..8be67ea94d3022ed66fb05015fd199d04212d39c 100644 --- a/src/test/java/org/orekit/rugged/TestUtils.java +++ b/src/test/java/org/orekit/rugged/TestUtils.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; import org.apache.commons.math3.util.FastMath; @@ -154,7 +155,7 @@ public class TestUtils { List<Vector3D> list = new ArrayList<Vector3D>(n); for (int i = 0; i < n; ++i) { double alpha = (halfAperture * (2 * i + 1 - n)) / (n - 1); - list.add(new Rotation(normal, alpha).applyTo(center)); + list.add(new Rotation(normal, alpha, RotationConvention.VECTOR_OPERATOR).applyTo(center)); } return new LOSBuilder(list).build(); } @@ -167,7 +168,9 @@ public class TestUtils { double x = (2.0 * i + 1.0 - n) / (n - 1); double alpha = x * halfAperture; double beta = x * x * sagitta; - list.add(new Rotation(normal, alpha).applyTo(new Rotation(u, beta).applyTo(center))); + list.add(new Rotation(normal, alpha, RotationConvention.VECTOR_OPERATOR). + applyTo(new Rotation(u, beta, RotationConvention.VECTOR_OPERATOR). + applyTo(center))); } return new LOSBuilder(list).build(); } diff --git a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java index e8cd88ec2c63c0dc3b09b6b2e1c51b01ca23bd24..c1310a8eeed7e8396f5f2e47452497e223fdba67 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java @@ -30,6 +30,7 @@ import java.util.Arrays; import java.util.List; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; import org.apache.commons.math3.util.FastMath; @@ -341,7 +342,8 @@ public class RuggedBuilderTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -409,7 +411,8 @@ public class RuggedBuilderTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -458,7 +461,8 @@ public class RuggedBuilderTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -665,7 +669,7 @@ public class RuggedBuilderTest { List<Vector3D> list = new ArrayList<Vector3D>(n); for (int i = 0; i < n; ++i) { double alpha = (halfAperture * (2 * i + 1 - n)) / (n - 1); - list.add(new Rotation(normal, alpha).applyTo(center)); + list.add(new Rotation(normal, alpha, RotationConvention.VECTOR_OPERATOR).applyTo(center)); } return new LOSBuilder(list).build(); } diff --git a/src/test/java/org/orekit/rugged/api/RuggedTest.java b/src/test/java/org/orekit/rugged/api/RuggedTest.java index 853b408814accfa01bce0047d14cd96d8d08330a..4ed3492c9ae16a4d7ac23de6eaccf2a9a16e0ea6 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedTest.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Locale; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import org.apache.commons.math3.stat.descriptive.rank.Percentile; @@ -321,7 +322,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -382,7 +384,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -439,7 +442,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -499,7 +503,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms @@ -565,7 +570,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking roughly at 50° roll (sensor-dependent), 2.6" per pixel Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0 - 0.001 * i)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0 - 0.001 * i), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(dimension * 2.6 / 3600.0), dimension); // linear datation model: at reference time we get roughly middle line, and the rate is one line every 1.5ms @@ -944,7 +950,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, 2.6" per pixel Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(dimension * 2.6 / 3600.0), dimension); @@ -1035,7 +1042,8 @@ public class RuggedTest { // los: swath in the (YZ) plane, looking at 50° roll, 2.6" per pixel Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(dimension * 2.6 / 3600.0), dimension); diff --git a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java index 46cb3d9890cad8b7fe296362c7faa03479d53c51..8f41011aefd3693c92cb78861391f8e26621ffa3 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.net.URISyntaxException; import org.apache.commons.math3.geometry.euclidean.threed.Rotation; +import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.util.FastMath; import org.junit.Assert; @@ -146,7 +147,8 @@ public class DumpManagerTest { // los: swath in the (YZ) plane, looking at 50° roll, ±1° aperture Vector3D position = new Vector3D(1.5, 0, -0.2); TimeDependentLOS los = TestUtils.createLOSPerfectLine(new Rotation(Vector3D.PLUS_I, - FastMath.toRadians(50.0)).applyTo(Vector3D.PLUS_K), + FastMath.toRadians(50.0), + RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(1.0), dimension); // linear datation model: at reference time we get line 100, and the rate is one line every 1.5ms