math.geom3d.line
Class StraightLine3D

Package class diagram package StraightLine3D
java.lang.Object
  extended by math.geom3d.line.StraightLine3D
All Implemented Interfaces:
Serializable, ContinuousCurve3D, Curve3D, Shape3D

public class StraightLine3D
extends Object
implements ContinuousCurve3D

Author:
dlegland
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface math.geom3d.Shape3D
Shape3D.EmptySet3D
 
Field Summary
protected  double dx
           
protected  double dy
           
protected  double dz
           
protected  double x0
           
protected  double y0
           
protected  double z0
           
 
Fields inherited from interface math.geom3d.Shape3D
ACCURACY, EMPTY_SET
 
Constructor Summary
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
 Shape3D clip(Box3D box)
           
 boolean contains(Point3D point)
           
 Box3D getBoundingBox()
           
 Collection<StraightLine3D> getContinuousCurves()
          Returns the collection of continuous curves which constitute this curve.
 Vector3D getDirection()
           
 double getDistance(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.
 Point3D getExamplePoint1()
           
 Point3D getExamplePoint2()
           
 Point3D getFirstPoint()
          Get the first point of the curve.
 Point3D getLastPoint()
          Get the last point of the curve.
 Point3D getOrigin()
           
 Point3D getPoint(double t)
          Gets the point from a parametric representation of the curve.
 Point3D getPoint(double t, Point3D point)
          Same as getPoint(t), but gives the point as a parameter.
 double getPosition(Point3D point)
          Get position of the point on the curve.
 StraightLine3D getReverseCurve()
          Returns the curve with same trace on the plane with parametrization in reverse order.
 Collection<Point3D> getSingularPoints()
          Returns an empty array of Point3D.
 Curve3D getSubCurve(double t0, double t1)
          Returns a portion of the original curve, delimited by two positions on the curve.
 double getT0()
          Returns -INFINITY;
 double getT1()
          Returns +INFINITY;
 boolean isBounded()
          Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape.
 boolean isEmpty()
           
 StraightLine3D project(Plane3D plane)
           
 double project(Point3D point)
          Compute the position of the orthogonal projection of the given point on this line.
 Point3D projectPoint(Point3D point)
           
 StraightLine3D transform(AffineTransform3D trans)
          Transforms the curve by an affine transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x0

protected double x0

y0

protected double y0

z0

protected double z0

dx

protected double dx

dy

protected double dy

dz

protected double dz
Constructor Detail

StraightLine3D

public StraightLine3D()

StraightLine3D

public StraightLine3D(Point3D origin,
                      Vector3D direction)

StraightLine3D

public StraightLine3D(Point3D p1,
                      Point3D p2)
Constructs a line passing through the 2 points.

Parameters:
p1 - the first point
p2 - the second point

StraightLine3D

public StraightLine3D(double x0,
                      double y0,
                      double z0,
                      double dx,
                      double dy,
                      double dz)
Method Detail

getOrigin

public Point3D getOrigin()

getExamplePoint1

public Point3D getExamplePoint1()

getExamplePoint2

public Point3D getExamplePoint2()

getDirection

public Vector3D getDirection()

project

public StraightLine3D project(Plane3D plane)

projectPoint

public Point3D projectPoint(Point3D point)

clip

public Shape3D clip(Box3D box)
Specified by:
clip in interface Shape3D

contains

public boolean contains(Point3D point)
Specified by:
contains in interface Shape3D

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Shape3D

isBounded

public boolean isBounded()
Description copied from interface: Shape3D
Returns 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.

Specified by:
isBounded in interface Shape3D

getBoundingBox

public Box3D getBoundingBox()
Specified by:
getBoundingBox in interface Shape3D

getDistance

public double getDistance(Point3D p)
Description copied from interface: Shape3D
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.

Specified by:
getDistance in interface Shape3D

transform

public StraightLine3D transform(AffineTransform3D trans)
Description copied from interface: Curve3D
Transforms the curve by an affine transform. The result is an instance of Curve3D.

Specified by:
transform in interface Curve3D
Specified by:
transform in interface Shape3D

getFirstPoint

public Point3D getFirstPoint()
Description copied from interface: Curve3D
Get the first point of the curve. It must returns the same result as getPoint(getT0()).

Specified by:
getFirstPoint in interface Curve3D
Returns:
the first point of the curve

getLastPoint

public Point3D getLastPoint()
Description copied from interface: Curve3D
Get the last point of the curve. It must returns the same result as getPoint(getT1()).

Specified by:
getLastPoint in interface Curve3D
Returns:
the last point of the curve.

getPoint

public Point3D getPoint(double t)
Description copied from interface: Curve3D
Gets 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.

Specified by:
getPoint in interface Curve3D

getPoint

public Point3D getPoint(double t,
                        Point3D point)
Description copied from interface: Curve3D
Same as getPoint(t), but gives the point as a parameter. This avoids repetitive memory allocations.

Specified by:
getPoint in interface Curve3D

getPosition

public double getPosition(Point3D point)
Description copied from interface: Curve3D
Get position of the point on the curve. If the point does not belong to the curve, return Double.NaN.

Specified by:
getPosition in interface Curve3D
Parameters:
point - a point belonging to the curve
Returns:
the position of the point on the curve

getReverseCurve

public StraightLine3D getReverseCurve()
Description copied from interface: Curve3D
Returns the curve with same trace on the plane with parametrization in reverse order.

Specified by:
getReverseCurve in interface Curve3D

getSingularPoints

public Collection<Point3D> getSingularPoints()
Returns an empty array of Point3D.

Specified by:
getSingularPoints in interface Curve3D
Returns:
a collection of Point3D.

getSubCurve

public Curve3D getSubCurve(double t0,
                           double t1)
Description copied from interface: Curve3D
Returns a portion of the original curve, delimited by two positions on the curve.

Specified by:
getSubCurve in interface Curve3D
Parameters:
t0 - position of the start of the sub-curve
t1 - position of the end of the sub-curve
Returns:
the portion of original curve comprised between t0 and t1.

getT0

public double getT0()
Returns -INFINITY;

Specified by:
getT0 in interface Curve3D

getT1

public double getT1()
Returns +INFINITY;

Specified by:
getT1 in interface Curve3D

project

public double project(Point3D point)
Compute the position of the orthogonal projection of the given point on this line.

Specified by:
project in interface Curve3D
Parameters:
point - a point to project
Returns:
the position of the closest orthogonal projection

getContinuousCurves

public Collection<StraightLine3D> getContinuousCurves()
Description copied from interface: Curve3D
Returns the collection of continuous curves which constitute this curve.

Specified by:
getContinuousCurves in interface Curve3D
Returns:
a collection of continuous curves.


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.