|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.geom2d.curve.AbstractContinuousCurve2D math.geom2d.curve.AbstractSmoothCurve2D math.geom2d.line.AbstractLine2D math.geom2d.line.LineSegment2D
public class LineSegment2D
Line segment, defined as the set of points located between the two end points.
Field Summary |
---|
Fields inherited from class math.geom2d.line.AbstractLine2D |
---|
dx, dy, x0, y0 |
Fields inherited from interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
LineSegment2D(double x1,
double y1,
double x2,
double y2)
Define a new Edge with two extremities. |
|
LineSegment2D(Point2D point1,
Point2D point2)
Define a new Edge with two extremities. |
Method Summary | |
---|---|
GeneralPath |
appendPath(GeneralPath path)
Appends a line to the current path. |
LineSegment2D |
clone()
Ensures public declaration of clone(), and ensures valid return type. |
boolean |
contains(double xp,
double yp)
Checks if the shape contains the planar point defined by (x,y). |
static LineSegment2D |
create(Point2D p1,
Point2D p2)
Static factory for creating a new line segment between two points. |
boolean |
equals(Object obj)
|
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
double |
getDistance(double x,
double y)
Get the distance of the point (x, y) to this edge. |
static double |
getEdgeAngle(LineSegment2D edge1,
LineSegment2D edge2)
Returns angle between two edges sharing one vertex. |
Point2D |
getFirstPoint()
Return the first point of the edge. |
GeneralPath |
getGeneralPath()
deprecated |
Point2D |
getLastPoint()
Return the last point of the edge. |
double |
getLength()
Returns the length of the line segment. |
StraightLine2D |
getMedian()
Return the median of the edge, that is the locus of points located at equal distance of each vertex. |
static StraightLine2D |
getMedian(LineSegment2D edge)
|
Point2D |
getOtherPoint(Point2D point)
Return the opposite vertex of the edge. |
LineSegment2D |
getParallel(double d)
Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)| , with p(t) being a point of
the original curve, n(t) the normal of the curve, and |n| being the
norm of n.In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc. |
Point2D |
getPoint(double t)
Gets the point from a parametric representation of the curve. |
LineSegment2D |
getReverseCurve()
Returns the LineSegment which start from last point of this line segment, and which ends at the fist point of this last segment. |
double |
getSignedDistance(double x,
double y)
Get the signed distance of the StraightObject2d to the given point. |
double |
getT0()
Returns the parameter of the first point of the edge, equals to 0. |
double |
getT1()
Returns the parameter of the last point of the edge, equals to 1. |
static boolean |
intersects(LineSegment2D edge1,
LineSegment2D edge2)
Checks if two line segment intersect. |
boolean |
isBounded()
Returns true |
void |
setLineSegment(double x1,
double y1,
double x2,
double y2)
Deprecated. lines will become immutable in a future release |
void |
setLineSegment(Point2D p1,
Point2D p2)
Deprecated. lines will become immutable in a future release |
String |
toString()
|
LineSegment2D |
transform(AffineTransform2D trans)
Transforms the curve by an affine transform. |
Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D |
---|
getLeftTangent, getRightTangent, getSingularPoints, isSingular |
Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
---|
draw, getAsAWTShape, getAsPolyline, wrapCurve |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface math.geom2d.circulinear.CirculinearElement2D |
---|
clip, getSubCurve, transform |
Methods inherited from interface math.geom2d.circulinear.CirculinearContinuousCurve2D |
---|
getSmoothPieces |
Methods inherited from interface math.geom2d.circulinear.CirculinearCurve2D |
---|
getContinuousCurves, getLength, getPosition |
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D |
---|
getBuffer |
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
---|
getAsPolyline, getLeftTangent, getRightTangent, isClosed |
Methods inherited from interface math.geom2d.domain.OrientedCurve2D |
---|
getSignedDistance, getWindingAngle, isInside |
Methods inherited from interface math.geom2d.curve.Curve2D |
---|
draw, getAsAWTShape, getIntersections, getPosition, getSingularPoints, isSingular, project |
Methods inherited from interface math.geom2d.Shape2D |
---|
contains, getDistance, isEmpty |
Methods inherited from interface math.geom2d.curve.SmoothCurve2D |
---|
getCurvature, getTangent |
Constructor Detail |
---|
public LineSegment2D(Point2D point1, Point2D point2)
public LineSegment2D(double x1, double y1, double x2, double y2)
Method Detail |
---|
public static final LineSegment2D create(Point2D p1, Point2D p2)
public static final StraightLine2D getMedian(LineSegment2D edge)
public static final double getEdgeAngle(LineSegment2D edge1, LineSegment2D edge2)
public static final boolean intersects(LineSegment2D edge1, LineSegment2D edge2)
edge1
- a line segmentedge2
- a line segment
public Point2D getOtherPoint(Point2D point)
point
- one of the vertices of the edge
public StraightLine2D getMedian()
@Deprecated public void setLineSegment(Point2D p1, Point2D p2)
@Deprecated public void setLineSegment(double x1, double y1, double x2, double y2)
public double getLength()
getLength
in interface CirculinearCurve2D
getLength
in class AbstractLine2D
public LineSegment2D getParallel(double d)
CirculinearCurve2D
p(t) = c(t) + d*n(t)/|n(t)|
, with p(t) being a point of
the original curve, n(t) the normal of the curve, and |n| being the
norm of n.
getParallel
in interface CirculinearContinuousCurve2D
getParallel
in interface CirculinearCurve2D
getParallel
in interface CirculinearElement2D
getParallel
in interface ContinuousCirculinearCurve2D
d
- the distance between the original curve and he parallel curve.
public double getSignedDistance(double x, double y)
AbstractLine2D
getSignedDistance
in interface OrientedCurve2D
getSignedDistance
in class AbstractLine2D
x
- x-coord of a pointy
- y-coord of a point
public Point2D getFirstPoint()
getFirstPoint
in interface Curve2D
getFirstPoint
in class AbstractContinuousCurve2D
public Point2D getLastPoint()
getLastPoint
in interface Curve2D
getLastPoint
in class AbstractContinuousCurve2D
public double getT0()
getT0
in interface Curve2D
public double getT1()
getT1
in interface Curve2D
public Point2D getPoint(double t)
Curve2D
getPoint
in interface Curve2D
public LineSegment2D getReverseCurve()
getReverseCurve
in interface CirculinearContinuousCurve2D
getReverseCurve
in interface CirculinearCurve2D
getReverseCurve
in interface CirculinearElement2D
getReverseCurve
in interface ContinuousCirculinearCurve2D
getReverseCurve
in interface ContinuousCurve2D
getReverseCurve
in interface Curve2D
getReverseCurve
in interface SmoothCurve2D
getReverseCurve
in interface ContinuousOrientedCurve2D
getReverseCurve
in interface OrientedCurve2D
getReverseCurve
in interface SmoothOrientedCurve2D
public boolean isBounded()
isBounded
in interface Shape2D
public boolean contains(double xp, double yp)
Shape2D
contains
in interface Shape2D
public double getDistance(double x, double y)
getDistance
in interface Shape2D
getDistance
in class AbstractLine2D
x
- x-coordinate of the pointy
- y-coordinate of the point
public LineSegment2D transform(AffineTransform2D trans)
Curve2D
transform
in interface ContinuousCurve2D
transform
in interface Curve2D
transform
in interface SmoothCurve2D
transform
in interface ContinuousOrientedCurve2D
transform
in interface OrientedCurve2D
transform
in interface SmoothOrientedCurve2D
transform
in interface LinearShape2D
transform
in interface Shape2D
transform
in class AbstractLine2D
trans
- an affine transform
public Box2D getBoundingBox()
Shape2D
getBoundingBox
in interface Shape2D
public GeneralPath appendPath(GeneralPath path)
appendPath
in interface ContinuousCurve2D
path
- the path to modify
public GeneralPath getGeneralPath()
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public LineSegment2D clone()
AbstractLine2D
clone
in interface Curve2D
clone
in class AbstractLine2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |