public class StraightLine extends AbstractCurve
Constructor and Description |
---|
StraightLine(PointND point,
PointND point2)
Creates a new Straight line passing from point to point2
|
StraightLine(PointND point,
SimpleVector dir)
Creates a StraightLine from point with direction dir
|
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(Transform t)
Applies the Transform t to the object.
|
double |
computeDistanceTo(PointND p)
Computes the closest distance between the line and the point p.
|
PointND |
evaluate(double u)
Returns a point on the Curve at position u [0, 1];
|
int |
getDimension()
Returns the external dimension of the shape.
|
SimpleVector |
getDirection() |
PointND |
getPoint() |
PointND[] |
getRasterPoints(int number)
Rasters the shape with a given number of points or less.
|
void |
init(PointND point,
PointND point2) |
void |
init(PointND point,
SimpleVector dir) |
java.util.ArrayList<PointND> |
intersect(AbstractCurve other)
Returns the intersection points between the curve and the shape.
|
PointND |
intersect(StraightLine line) |
PointND |
intersect(StraightLine line,
double threshold) |
boolean |
isBounded()
Returns true if the shape is of limited space
|
void |
normalize() |
void |
setDirection(SimpleVector direction) |
void |
setPoint(PointND point) |
java.lang.String |
toString() |
evaluate, getInternalDimension
getHitsOnBoundingBox_slow, getHitsOnBoundingBox, getMax, getMin, getName, setName
public StraightLine(PointND point, SimpleVector dir)
point
- the pointdir
- the directionpublic void init(PointND point, SimpleVector dir)
public void normalize()
public PointND evaluate(double u)
AbstractCurve
evaluate
in class AbstractCurve
u
- the internal one dimensional positionpublic int getDimension()
AbstractShape
getDimension
in class AbstractShape
public java.util.ArrayList<PointND> intersect(AbstractCurve other)
AbstractShape
intersect
in class AbstractShape
public PointND intersect(StraightLine line)
public PointND intersect(StraightLine line, double threshold)
public SimpleVector getDirection()
public void setDirection(SimpleVector direction)
direction
- the direction to setpublic PointND getPoint()
public void setPoint(PointND point)
point
- the point to setpublic boolean isBounded()
AbstractShape
isBounded
in class AbstractShape
public double computeDistanceTo(PointND p)
p
- the point ppublic void applyTransform(Transform t)
Transformable
applyTransform
in interface Transformable
applyTransform
in class AbstractShape
t
- the transform to apply to the object.public PointND[] getRasterPoints(int number)
AbstractShape
getRasterPoints
in class AbstractShape
number
- the number of pointspublic java.lang.String toString()
toString
in class java.lang.Object