From d822c78a9c4214eaa06fbac9cf67df1008133b77 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Wed, 10 Jun 2015 11:47:15 +0200 Subject: [PATCH] Added a constructor directly from polynomial function. --- .../orekit/rugged/los/PolynomialRotation.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index 142e9b12..da58232b 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -68,9 +68,28 @@ public class PolynomialRotation implements LOSTransform { final Vector3D axis, final AbsoluteDate referenceDate, final double ... angleCoeffs) { + this(type, axis, referenceDate, new PolynomialFunction(angleCoeffs)); + } + + /** Simple constructor. + * <p> + * The angle of the rotation is evaluated as a polynomial in t, + * where t is the duration in seconds between evaluation date and + * reference date. The parameters are the polynomial coefficients, + * with the constant term at index 0. + * </p> + * @param type parameters type + * @param axis rotation axis + * @param referenceDate reference date for the polynomial angle + * @param angle polynomial angle + */ + public PolynomialRotation(final ParameterType type, + final Vector3D axis, + final AbsoluteDate referenceDate, + final PolynomialFunction angle) { this.type = type; this.axis = axis; - this.angle = new PolynomialFunction(angleCoeffs); + this.angle = angle; this.referenceDate = referenceDate; } -- GitLab