math.geom3d.line
Class StraightLine3D
- java.lang.Object
-
- math.geom3d.line.StraightLine3D
-
- All Implemented Interfaces:
- ContinuousCurve3D, Curve3D, Shape3D
public class StraightLine3D extends java.lang.Object implements ContinuousCurve3D
-
-
Constructor Summary
Constructors Constructor and Description StraightLine3D()StraightLine3D(double x0, double y0, double z0, double dx, double dy, double dz)StraightLine3D(Point3D p1, Point3D p2)Constructs a line passing through the 2 points.StraightLine3D(Point3D origin, Vector3D direction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Box3DboundingBox()Shape3Dclip(Box3D box)booleancontains(Point3D point)java.util.Collection<StraightLine3D>continuousCurves()Returns the collection of continuous curves which constitute this curve.Vector3Ddirection()doubledistance(Point3D p)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()Returns -INFINITY;doublegetT1()Returns +INFINITY;booleanisBounded()Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape.booleanisEmpty()Point3DlastPoint()Get the last point of the curve.Point3Dorigin()Point3Dpoint(double t)Gets the point from a parametric representation of the curve.doubleposition(Point3D point)Get position of the point on the curve.StraightLine2Dproject(Plane3D plane)not yet implementeddoubleproject(Point3D point)Compute the position of the orthogonal projection of the given point on this line.StraightLine3DreverseCurve()Returns the curve with same trace on the plane with parametrization in reverse order.java.util.Collection<Point3D>singularPoints()Returns an empty array of Point3D.Curve3DsubCurve(double t0, double t1)Returns a portion of the original curve, delimited by two positions on the curve.StraightLine3Dtransform(AffineTransform3D trans)Transforms the curve by an affine transform.
-
-
-
Constructor Detail
-
StraightLine3D
public StraightLine3D()
-
StraightLine3D
public StraightLine3D(Point3D p1, Point3D p2)
Constructs a line passing through the 2 points.- Parameters:
p1- the first pointp2- the second point
-
StraightLine3D
public StraightLine3D(double x0, double y0, double z0, double dx, double dy, double dz)
-
-
Method Detail
-
origin
public Point3D origin()
-
direction
public Vector3D direction()
-
project
public StraightLine2D project(Plane3D plane)
not yet implemented
-
isBounded
public boolean isBounded()
Description copied from interface:Shape3DReturns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. For example, a straight line or a parabola are not bounded.
-
boundingBox
public Box3D boundingBox()
- Specified by:
boundingBoxin interfaceShape3D
-
distance
public double distance(Point3D p)
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.
-
transform
public StraightLine3D transform(AffineTransform3D trans)
Description copied from interface:Curve3DTransforms the curve by an affine transform. The result is an instance of Curve3D.
-
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)
Description copied from interface:Curve3DGet position of the point on the curve. If the point does not belong to the curve, return Double.NaN.
-
reverseCurve
public StraightLine3D 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 an empty array of Point3D.- Specified by:
singularPointsin interfaceCurve3D- Returns:
- a collection of Point3D.
-
subCurve
public Curve3D subCurve(double t0, double t1)
Description copied from interface:Curve3DReturns a portion of the original curve, delimited by two positions on the curve.
-
project
public double project(Point3D point)
Compute the position of the orthogonal projection of the given point on this line.
-
continuousCurves
public java.util.Collection<StraightLine3D> 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG