/** * Computes the line on which this line segment is lying. * The line's vector is the direction from the first to the second endpoint * of this line segment. * * @return the line on which this line segment is lying. */ public Line3d getLineCopy() { return new Line3d(firstEndpoint, secondEndpoint); }
/** * Compute the 3D equivalent of this line segment. * The 3D equivalent of each end point is computed as follows: * {@code endPoint3d = endPoint1d * lineDirection3d + lineStart3d}. * @param line3d the 3D line used as reference to compute the 3D line segment. * @return the 3D equivalent of this line segment. */ public LineSegment3d toLineSegment3d(Line3d line3d) { return toLineSegment3d(line3d.getPoint(), line3d.getNormalizedVector()); }
/** * Computes the line on which this line segment is lying. * The line's vector is the direction from the first to the second endpoint * of this line segment. * * @param lineToPack the line on which this line segment is lying. */ public void getLine(Line3d lineToPack) { lineToPack.set(firstEndpoint, secondEndpoint); }
public void setPointWithoutChecks(Point3d point) { line.setPoint(point); }
public Vector3d getNormalizedVector() { return line.getNormalizedVector(); }
public void setVectorWithoutChecks(Vector3d vector) { line.setVector(vector); }
public Point3d getPoint() { return line.getPoint(); }
/** * Changes the direction of this line by setting to the normalized value of the given vector. * * @param vector new direction of this line. Not modified. */ public void setVector(Vector3d vector) { this.normalizedVector.set(vector); normalize(); }
@Override public boolean epsilonEquals(FrameLine otherLine, double epsilon) { checkReferenceFrameMatch(otherLine); return line.epsilonEquals(otherLine.getGeometryObject(), epsilon); }
/** * Redefines this line such that it goes through the two given points. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. */ public void set(Point3d firstPointOnLine, Point3d secondPointOnLine) { setPoint(firstPointOnLine); normalizedVector.sub(secondPointOnLine, firstPointOnLine); normalizedVector.normalize(); }
public Vector3d getNormalizedVectorCopy() { return new Vector3d(line.getNormalizedVector()); }
public void setVector(FrameVector vector) { checkReferenceFrameMatch(vector); line.setVector(vector.getVector()); }
public Point3d getPointCopy() { return new Point3d(line.getPoint()); }
public void projectOntoXYPlane(Line2d lineToPack) { lineToPack.set(line.getPoint().getX(), line.getPoint().getY(), line.getNormalizedVector().getX(), line.getNormalizedVector().getY()); }
public FrameLine(ReferenceFrame referenceFrame, Point3d point, Vector3d vector) { this(referenceFrame, new Line3d(point, vector)); }
public void setPoint(FramePoint point) { checkReferenceFrameMatch(point); line.setPoint(point.getPoint()); }
/** * Initializes this line to be passing through the given point, with the vector as the direction. * * @param point point on this line. Not modified. * @param vector direction of this line. Not modified. */ public Line3d(Point3d point, Vector3d vector) { set(point, vector); }
public FrameVector getFrameNormalizedVectorCopy() { return new FrameVector(referenceFrame, line.getNormalizedVector()); }
public void projectOntoXYPlane(FrameLine2d lineToPack) { lineToPack.set(getReferenceFrame(), line.getPoint().getX(), line.getPoint().getY(), line.getNormalizedVector().getX(), line.getNormalizedVector().getY()); }