Example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getZ

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D getZ

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getZ.

Prototype

public double getZ() 

Source Link

Document

Get the height of the vector.

Usage

From source file:org.orekit.orbits.Orbit.java

/** Fill a Jacobian half row with a linear combination of vectors.
 * @param a1 coefficient of the first vector
 * @param v1 first vector/*  w w  w.jav  a2  s.c  o m*/
 * @param a2 coefficient of the second vector
 * @param v2 second vector
 * @param row Jacobian matrix row
 * @param j index of the first element to set (row[j], row[j+1] and row[j+2] will all be set)
 */
protected static void fillHalfRow(final double a1, final Vector3D v1, final double a2, final Vector3D v2,
        final double[] row, final int j) {
    row[j] = a1 * v1.getX() + a2 * v2.getX();
    row[j + 1] = a1 * v1.getY() + a2 * v2.getY();
    row[j + 2] = a1 * v1.getZ() + a2 * v2.getZ();
}

From source file:org.orekit.orbits.Orbit.java

/** Fill a Jacobian half row with a linear combination of vectors.
 * @param a1 coefficient of the first vector
 * @param v1 first vector/*from  w  ww  . java 2 s.  c  o m*/
 * @param a2 coefficient of the second vector
 * @param v2 second vector
 * @param a3 coefficient of the third vector
 * @param v3 third vector
 * @param row Jacobian matrix row
 * @param j index of the first element to set (row[j], row[j+1] and row[j+2] will all be set)
 */
protected static void fillHalfRow(final double a1, final Vector3D v1, final double a2, final Vector3D v2,
        final double a3, final Vector3D v3, final double[] row, final int j) {
    row[j] = a1 * v1.getX() + a2 * v2.getX() + a3 * v3.getX();
    row[j + 1] = a1 * v1.getY() + a2 * v2.getY() + a3 * v3.getY();
    row[j + 2] = a1 * v1.getZ() + a2 * v2.getZ() + a3 * v3.getZ();
}

From source file:org.orekit.orbits.Orbit.java

/** Fill a Jacobian half row with a linear combination of vectors.
 * @param a1 coefficient of the first vector
 * @param v1 first vector//from  ww w  .j  a  v  a 2  s . co  m
 * @param a2 coefficient of the second vector
 * @param v2 second vector
 * @param a3 coefficient of the third vector
 * @param v3 third vector
 * @param a4 coefficient of the fourth vector
 * @param v4 fourth vector
 * @param row Jacobian matrix row
 * @param j index of the first element to set (row[j], row[j+1] and row[j+2] will all be set)
 */
protected static void fillHalfRow(final double a1, final Vector3D v1, final double a2, final Vector3D v2,
        final double a3, final Vector3D v3, final double a4, final Vector3D v4, final double[] row,
        final int j) {
    row[j] = a1 * v1.getX() + a2 * v2.getX() + a3 * v3.getX() + a4 * v4.getX();
    row[j + 1] = a1 * v1.getY() + a2 * v2.getY() + a3 * v3.getY() + a4 * v4.getY();
    row[j + 2] = a1 * v1.getZ() + a2 * v2.getZ() + a3 * v3.getZ() + a4 * v4.getZ();
}

From source file:org.orekit.orbits.Orbit.java

/** Fill a Jacobian half row with a linear combination of vectors.
 * @param a1 coefficient of the first vector
 * @param v1 first vector/*ww  w  .j  a  v  a2s  .  co  m*/
 * @param a2 coefficient of the second vector
 * @param v2 second vector
 * @param a3 coefficient of the third vector
 * @param v3 third vector
 * @param a4 coefficient of the fourth vector
 * @param v4 fourth vector
 * @param a5 coefficient of the fifth vector
 * @param v5 fifth vector
 * @param row Jacobian matrix row
 * @param j index of the first element to set (row[j], row[j+1] and row[j+2] will all be set)
 */
protected static void fillHalfRow(final double a1, final Vector3D v1, final double a2, final Vector3D v2,
        final double a3, final Vector3D v3, final double a4, final Vector3D v4, final double a5,
        final Vector3D v5, final double[] row, final int j) {
    row[j] = a1 * v1.getX() + a2 * v2.getX() + a3 * v3.getX() + a4 * v4.getX() + a5 * v5.getX();
    row[j + 1] = a1 * v1.getY() + a2 * v2.getY() + a3 * v3.getY() + a4 * v4.getY() + a5 * v5.getY();
    row[j + 2] = a1 * v1.getZ() + a2 * v2.getZ() + a3 * v3.getZ() + a4 * v4.getZ() + a5 * v5.getZ();
}

From source file:org.orekit.orbits.Orbit.java

/** Fill a Jacobian half row with a linear combination of vectors.
 * @param a1 coefficient of the first vector
 * @param v1 first vector//from  w  ww .j a  va 2 s . com
 * @param a2 coefficient of the second vector
 * @param v2 second vector
 * @param a3 coefficient of the third vector
 * @param v3 third vector
 * @param a4 coefficient of the fourth vector
 * @param v4 fourth vector
 * @param a5 coefficient of the fifth vector
 * @param v5 fifth vector
 * @param a6 coefficient of the sixth vector
 * @param v6 sixth vector
 * @param row Jacobian matrix row
 * @param j index of the first element to set (row[j], row[j+1] and row[j+2] will all be set)
 */
protected static void fillHalfRow(final double a1, final Vector3D v1, final double a2, final Vector3D v2,
        final double a3, final Vector3D v3, final double a4, final Vector3D v4, final double a5,
        final Vector3D v5, final double a6, final Vector3D v6, final double[] row, final int j) {
    row[j] = a1 * v1.getX() + a2 * v2.getX() + a3 * v3.getX() + a4 * v4.getX() + a5 * v5.getX()
            + a6 * v6.getX();
    row[j + 1] = a1 * v1.getY() + a2 * v2.getY() + a3 * v3.getY() + a4 * v4.getY() + a5 * v5.getY()
            + a6 * v6.getY();
    row[j + 2] = a1 * v1.getZ() + a2 * v2.getZ() + a3 * v3.getZ() + a4 * v4.getZ() + a5 * v5.getZ()
            + a6 * v6.getZ();
}

From source file:org.orekit.OrekitMatchers.java

/**
 * Matches a {@link Vector3D} based on its three coordinates.
 *
 * @param x matcher for the x coordinate
 * @param y matcher for the y coordinate
 * @param z matcher for the z coordinate
 * @return a vector matcher/*from  w  w  w . j av a  2  s.co m*/
 */
public static Matcher<Vector3D> vector(final Matcher<Double> x, final Matcher<Double> y,
        final Matcher<Double> z) {
    return new TypeSafeDiagnosingMatcher<Vector3D>() {
        @Override
        public void describeTo(Description description) {
            description.appendList("Vector3D[", ",", "]", Arrays.<SelfDescribing>asList(x, y, z));
        }

        @Override
        protected boolean matchesSafely(Vector3D item, Description mismatchDescription) {
            if (!x.matches(item.getX())) {
                mismatchDescription.appendText("the x coordinate ");
                x.describeMismatch(item.getX(), mismatchDescription);
                return false;
            }
            if (!y.matches(item.getY())) {
                mismatchDescription.appendText("the y coordinate ");
                y.describeMismatch(item.getY(), mismatchDescription);
                return false;
            }
            if (!z.matches(item.getZ())) {
                mismatchDescription.appendText("the z coordinate ");
                z.describeMismatch(item.getZ(), mismatchDescription);
                return false;
            }
            return true;
        }
    };
}

From source file:org.orekit.OrekitMatchers.java

/**
 * Matches a {@link Vector3D} close to another one.
 *
 * @param vector the reference vector//from   w  ww  . j a v a2 s .c  o  m
 * @param absTol absolute tolerance of comparison, in each dimension
 * @return a vector matcher.
 */
public static Matcher<Vector3D> vectorCloseTo(Vector3D vector, double absTol) {
    return vector(closeTo(vector.getX(), absTol), closeTo(vector.getY(), absTol),
            closeTo(vector.getZ(), absTol));
}

From source file:org.orekit.OrekitMatchers.java

/**
 * Matches a {@link Vector3D} close to another one.
 *
 * @param vector the reference vector/*from  w  w w. j a v a  2s . co  m*/
 * @param ulps   the relative tolerance, in units in last place, of the
 *               Comparison of each dimension.
 * @return a vector matcher.
 */
public static Matcher<Vector3D> vectorCloseTo(Vector3D vector, int ulps) {
    return vector(relativelyCloseTo(vector.getX(), ulps), relativelyCloseTo(vector.getY(), ulps),
            relativelyCloseTo(vector.getZ(), ulps));
}

From source file:org.orekit.OrekitMatchers.java

/**
 * Matches a {@link Vector3D} to another one.
 *
 * @param vector the reference vector//w w  w.j  ava  2 s  .  co m
 * @param absTol the absolute tolerance of comparison, in each dimension.
 * @param ulps   the relative tolerance of comparison in each dimension, in
 *               units in last place.
 * @return a matcher that matches if either the absolute or relative
 * comparison matches in each dimension.
 */
public static Matcher<Vector3D> vectorCloseTo(Vector3D vector, double absTol, int ulps) {
    return vector(numberCloseTo(vector.getX(), absTol, ulps), numberCloseTo(vector.getY(), absTol, ulps),
            numberCloseTo(vector.getZ(), absTol, ulps));
}

From source file:org.orekit.propagation.numerical.NumericalPropagatorTest.java

@Test
public void testNoExtrapolation() throws OrekitException {

    // Propagate of the initial at the initial date
    final SpacecraftState finalState = propagator.propagate(initDate);

    // Initial orbit definition
    final Vector3D initialPosition = initialState.getPVCoordinates().getPosition();
    final Vector3D initialVelocity = initialState.getPVCoordinates().getVelocity();

    // Final orbit definition
    final Vector3D finalPosition = finalState.getPVCoordinates().getPosition();
    final Vector3D finalVelocity = finalState.getPVCoordinates().getVelocity();

    // Check results
    Assert.assertEquals(initialPosition.getX(), finalPosition.getX(), 1.0e-10);
    Assert.assertEquals(initialPosition.getY(), finalPosition.getY(), 1.0e-10);
    Assert.assertEquals(initialPosition.getZ(), finalPosition.getZ(), 1.0e-10);
    Assert.assertEquals(initialVelocity.getX(), finalVelocity.getX(), 1.0e-10);
    Assert.assertEquals(initialVelocity.getY(), finalVelocity.getY(), 1.0e-10);
    Assert.assertEquals(initialVelocity.getZ(), finalVelocity.getZ(), 1.0e-10);

}