math.geom3d.line
Class LineSegment3D
- java.lang.Object
-
- math.geom3d.line.LineSegment3D
-
- All Implemented Interfaces:
- ContinuousCurve3D, Curve3D, Shape3D
public class LineSegment3D extends java.lang.Object implements ContinuousCurve3D
-
-
Constructor Summary
Constructors Constructor and Description LineSegment3D(Point3D p1, Point3D p2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Box3DboundingBox()Shape3Dclip(Box3D box)booleancontains(Point3D point)java.util.Collection<LineSegment3D>continuousCurves()Returns the collection of continuous curves which constitute this curve.doubledistance(Point3D point)Gets the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.Point3DfirstPoint()Get the first point of the curve.doublegetT0()Return 0, by definition of LineSegment.doublegetT1()Return 1, by definition of LineSegment.booleanisBounded()Returns true, as a LineSegment3D is always bounded.booleanisEmpty()Returns false, as a LineSegment3D is never empty.Point3DlastPoint()Get the last point of the curve.Point3Dpoint(double t)Gets the point from a parametric representation of the curve.doubleposition(Point3D point)If point does not project on the line segment, return Double.NaN.doubleproject(Point3D point)Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point.Curve3DreverseCurve()Returns the curve with same trace on the plane with parametrization in reverse order.java.util.Collection<Point3D>singularPoints()Returns the2 end points.LineSegment3DsubCurve(double t0, double t1)Returns a portion of the original curve, delimited by two positions on the curve.StraightLine3DsupportingLine()Curve3Dtransform(AffineTransform3D trans)Transforms the curve by an affine transform.
-
-
-
Method Detail
-
supportingLine
public StraightLine3D supportingLine()
-
continuousCurves
public java.util.Collection<LineSegment3D> continuousCurves()
Description copied from interface:Curve3DReturns the collection of continuous curves which constitute this curve.- Specified by:
continuousCurvesin interfaceCurve3D- Returns:
- a collection of continuous curves.
-
firstPoint
public Point3D firstPoint()
Description copied from interface:Curve3DGet the first point of the curve. It must returns the same result asgetPoint(getT0()).- Specified by:
firstPointin interfaceCurve3D- Returns:
- the first point of the curve
-
lastPoint
public Point3D lastPoint()
Description copied from interface:Curve3DGet the last point of the curve. It must returns the same result asgetPoint(getT1()).
-
point
public Point3D point(double t)
Description copied from interface:Curve3DGets the point from a parametric representation of the curve. If the parameter lies outside the definition range, the parameter corresponding to the closest bound is used instead. This method can be used to draw an approximated outline of a curve, by selecting multiple values for t and drawing lines between them.
-
position
public double position(Point3D point)
If point does not project on the line segment, return Double.NaN.- Specified by:
positionin interfaceCurve3D- Parameters:
point- a point belonging to the curve- Returns:
- the position of the point on the curve
- See Also:
Curve3D.position(math.geom3d.Point3D)
-
reverseCurve
public Curve3D reverseCurve()
Description copied from interface:Curve3DReturns the curve with same trace on the plane with parametrization in reverse order.- Specified by:
reverseCurvein interfaceCurve3D
-
singularPoints
public java.util.Collection<Point3D> singularPoints()
Returns the2 end points.- Specified by:
singularPointsin interfaceCurve3D- Returns:
- a collection of Point3D.
- See Also:
Curve3D.singularPoints()
-
subCurve
public LineSegment3D subCurve(double t0, double t1)
Description copied from interface:Curve3DReturns a portion of the original curve, delimited by two positions on the curve.
-
getT0
public double getT0()
Return 0, by definition of LineSegment.- Specified by:
getT0in interfaceCurve3D- See Also:
Curve3D.getT0()
-
getT1
public double getT1()
Return 1, by definition of LineSegment.- Specified by:
getT1in interfaceCurve3D- See Also:
Curve3D.getT1()
-
project
public double project(Point3D point)
Description copied from interface:Curve3DReturns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. This function should always returns a valid value.
-
transform
public Curve3D transform(AffineTransform3D trans)
Description copied from interface:Curve3DTransforms the curve by an affine transform. The result is an instance of Curve3D.
-
boundingBox
public Box3D boundingBox()
- Specified by:
boundingBoxin interfaceShape3D
-
distance
public double distance(Point3D point)
Description copied from interface:Shape3DGets the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
-
isBounded
public boolean isBounded()
Returns true, as a LineSegment3D is always bounded.- Specified by:
isBoundedin interfaceShape3D- See Also:
Shape3D.isBounded()
-
isEmpty
public boolean isEmpty()
Returns false, as a LineSegment3D is never empty.- Specified by:
isEmptyin interfaceShape3D- See Also:
Shape3D.isEmpty()
-
-
DMelt 3.0 © DataMelt by jWork.ORG