public final double getY() { return tuple.getY(); }
/** FramePoint2d <p/> A normal point2d associated with a specific reference frame. */ public FramePoint2d(ReferenceFrame referenceFrame, Tuple2d position, String name) { this(referenceFrame, position.getX(), position.getY(), name); }
/** FrameVector2d <p/> A normal vector2d associated with a specific reference frame. */ public FrameVector2d(ReferenceFrame referenceFrame, Tuple2d tuple) { this(referenceFrame, tuple.getX(), tuple.getY()); }
/** FrameVector2d <p/> A normal vector2d associated with a specific reference frame. */ public FrameVector2d(FrameTuple2d<?, ?> frameTuple2d) { this(frameTuple2d.referenceFrame, frameTuple2d.tuple.getX(), frameTuple2d.tuple.getY(), frameTuple2d.name); }
/** FramePoint2d <p/> A normal point2d associated with a specific reference frame. */ public FramePoint2d(FrameTuple2d<?, ?> frameTuple2d) { this(frameTuple2d.referenceFrame, frameTuple2d.tuple.getX(), frameTuple2d.tuple.getY(), frameTuple2d.name); }
public final boolean containsNaN() { return Double.isNaN(tuple.getX()) || Double.isNaN(tuple.getY()); }
/** FramePoint2d <p/> A normal point2d associated with a specific reference frame. */ public FramePoint2d(ReferenceFrame referenceFrame, Tuple2d position) { this(referenceFrame, position.getX(), position.getY(), null); }
public final double[] toArray() { return new double[] { tuple.getX(), tuple.getY() }; }
@Override public List<FramePoint> getContactPointsCopy() { List<FramePoint> ret = new ArrayList<FramePoint>(contactPoints.size()); for (int i = 0; i < contactPoints.size(); i++) { Tuple2d point = contactPoints.get(i); ret.add(new FramePoint(soleFrame, point.getX(), point.getY(), 0.0)); } return ret; }
/** * Checks the validity of a {@link Tuple2d} * @param tuple2dToCheck * @return null if the tuple2d is valid, or the error message. */ public static ObjectErrorType validateTuple2d(Tuple2d tuple2dToCheck) { if (tuple2dToCheck == null) return ObjectErrorType.NULL; if (isNaN(tuple2dToCheck.getX()) || isNaN(tuple2dToCheck.getY())) return ObjectErrorType.CONTAINS_NaN; if (isInfinite(tuple2dToCheck.getX()) || isInfinite(tuple2dToCheck.getY())) return ObjectErrorType.CONTAINS_INFINITY; return null; }
/** * Pack this tuple2d in tuple3fToPack and tuple3fToPack.z = 0.0. * @param tuple3fToPack {@code Tuple3f} */ public final void get(Tuple3f tuple3fToPack) { tuple3fToPack.set((float) tuple.getX(), (float) tuple.getY(), 0.0f); }
/** * Pack this tuple2d in tuple3dToPack and tuple3dToPack.z = 0.0. * @param tuple3dToPack {@code Tuple3d} */ public final void get(Tuple3d tuple3dToPack) { tuple3dToPack.set(tuple.getX(), tuple.getY(), 0.0); }
/** * Sets the value of this tuple to the scalar multiplication of tuple1 and then adds the scalar multiplication of tuple2 (this = scaleFactor1 * tuple1 + scaleFactor2 * tuple2). * * @param scaleFactor1 double * @param frameTuple1 Tuple2d * @param scaleFactor2 double * @param frameTuple2 Tuple2d */ public final void scaleAdd(double scaleFactor1, Tuple2d tuple1, double scaleFactor2, Tuple2d tuple2) { tuple.setX(scaleFactor1 * tuple1.getX() + scaleFactor2 * tuple2.getX()); tuple.setY(scaleFactor1 * tuple1.getY() + scaleFactor2 * tuple2.getY()); }
public final void add(double dx, double dy) { tuple.setX(tuple.getX() + dx); tuple.setY(tuple.getY() + dy); }
public void update(Tuple2d value) { update(value.getX()); update(value.getY()); }
public final void scale(double scaleXFactor, double scaleYFactor) { tuple.setX(tuple.getX() * scaleXFactor); tuple.setY(tuple.getY() * scaleYFactor); }
public static void setDenseMatrixFromTuple2d(DenseMatrix64F matrixToPack, Tuple2d tuple, int startRow, int startColumn) { matrixToPack.set(startRow + 0, startColumn, tuple.getX()); matrixToPack.set(startRow + 1, startColumn, tuple.getY()); }
public final void sub(double dx, double dy) { tuple.setX(tuple.getX() - dx); tuple.setY(tuple.getY() - dy); }
/** * Set the x and y components of this frameTuple to tuple2d.x and tuple2d.y respectively, and sets the z component to zero. * @param tuple2d */ public void setXY(Tuple2d tuple2d) { this.tuple.setX(tuple2d.getX()); this.tuple.setY(tuple2d.getY()); this.tuple.setZ(0.0); }