|
||||||||||
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 interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
LineSegment2D(double x1,
double y1,
double x2,
double y2)
Defines a new Edge with two extremities. |
|
LineSegment2D(Point2D point1,
Point2D point2)
Defines a new Edge with two extremities. |
Method Summary | |
---|---|
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Checks if the two objects are similar up to a given threshold value. |
java.awt.geom.GeneralPath |
appendPath(java.awt.geom.GeneralPath path)
Appends a line to the current path. |
Box2D |
boundingBox()
Returns the bounding box of this line segment. |
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)
Deprecated. since 0.11.1 |
double |
distance(double x,
double y)
Get the distance of the point (x, y) to this edge. |
boolean |
equals(java.lang.Object obj)
|
Point2D |
firstPoint()
Returns the first point of the edge. |
static double |
getEdgeAngle(LineSegment2D edge1,
LineSegment2D edge2)
Returns angle between two edges sharing one vertex. |
java.awt.geom.GeneralPath |
getGeneralPath()
deprecated |
StraightLine2D |
getMedian()
Returns the median of the edge, that is the locus of points located at equal distance of each vertex. |
static StraightLine2D |
getMedian(LineSegment2D edge)
Returns the straight line that is the median of the edge extremities. |
double |
getT0()
Deprecated. replaced by t0() (since 0.11.1). |
double |
getT1()
Deprecated. replaced by t1() (since 0.11.1). |
static boolean |
intersects(LineSegment2D edge1,
LineSegment2D edge2)
Checks if two line segment intersect. |
boolean |
isBounded()
Returns true |
Point2D |
lastPoint()
Returns the last point of the edge. |
double |
length()
Returns the length of the line segment. |
Point2D |
opposite(Point2D point)
Returns the opposite vertex of the edge. |
LineSegment2D |
parallel(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. |
Point2D |
point(double t)
Returns the point located at the given position on the curve. |
LineSegment2D |
reverse()
Returns the LineSegment which start from last point of this line segment, and which ends at the fist point of this last segment. |
double |
signedDistance(double x,
double y)
Returns the signed distance of the StraightObject2d to the given point. |
double |
t0()
Returns the parameter of the first point of the edge, equals to 0. |
double |
t1()
Returns the parameter of the last point of the edge, equals to 1. |
java.lang.String |
toString()
|
LineSegment2D |
transform(AffineTransform2D trans)
Transforms the curve by an affine transform. |
Methods inherited from class math.geom2d.line.AbstractLine2D |
---|
buffer, cartesianEquation, clip, contains, continuousCurves, curvature, direction, distance, getIntersection, getSymmetric, getSymmetric, horizontalAngle, intersection, intersections, isClosed, isColinear, isColinear, isEmpty, isInside, isParallel, isParallel, length, origin, parallel, parametric, perpendicular, polarCoefficients, polarCoefficientsSigned, position, position, positionOnLine, positionOnLine, project, projectedPoint, projectedPoint, signedDistance, smoothPieces, subCurve, supportingLine, tangent, transform, windingAngle |
Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D |
---|
isSingular, leftTangent, normal, rightTangent, singularPoints, vertices |
Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
---|
asAwtShape, asPolyline, draw |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface math.geom2d.circulinear.CirculinearElement2D |
---|
clip, subCurve, transform |
Methods inherited from interface math.geom2d.circulinear.CirculinearContinuousCurve2D |
---|
smoothPieces |
Methods inherited from interface math.geom2d.circulinear.CirculinearCurve2D |
---|
continuousCurves, length, position |
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D |
---|
buffer |
Methods inherited from interface math.geom2d.curve.SmoothCurve2D |
---|
normal, tangent |
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
---|
asPolyline, curvature, isClosed, leftTangent, rightTangent |
Methods inherited from interface math.geom2d.domain.OrientedCurve2D |
---|
isInside, signedDistance, windingAngle |
Methods inherited from interface math.geom2d.curve.Curve2D |
---|
asAwtShape, draw, intersections, isSingular, position, project, singularPoints, vertices |
Methods inherited from interface math.geom2d.Shape2D |
---|
contains, distance, isEmpty |
Constructor Detail |
---|
public LineSegment2D(Point2D point1, Point2D point2)
public LineSegment2D(double x1, double y1, double x2, double y2)
Method Detail |
---|
@Deprecated public static LineSegment2D create(Point2D p1, Point2D p2)
public static StraightLine2D getMedian(LineSegment2D edge)
public static double getEdgeAngle(LineSegment2D edge1, LineSegment2D edge2)
public static boolean intersects(LineSegment2D edge1, LineSegment2D edge2)
edge1
- a line segmentedge2
- a line segment
public Point2D opposite(Point2D point)
point
- one of the vertices of the edge
public StraightLine2D getMedian()
public double length()
length
in interface CirculinearCurve2D
length
in class AbstractLine2D
public LineSegment2D parallel(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.
parallel
in interface CirculinearContinuousCurve2D
parallel
in interface CirculinearCurve2D
parallel
in interface CirculinearElement2D
d
- the distance between the original curve and he parallel curve.
public double signedDistance(double x, double y)
AbstractLine2D
signedDistance
in interface OrientedCurve2D
signedDistance
in class AbstractLine2D
x
- x-coord of a pointy
- y-coord of a point
public Point2D firstPoint()
firstPoint
in interface Curve2D
firstPoint
in class AbstractContinuousCurve2D
Curve2D.t0()
,
Curve2D.point(double)
public Point2D lastPoint()
lastPoint
in interface Curve2D
lastPoint
in class AbstractContinuousCurve2D
Curve2D.t1()
,
Curve2D.point(double)
public double t0()
t0
in interface Curve2D
@Deprecated public double getT0()
getT0
in interface Curve2D
public double t1()
t1
in interface Curve2D
@Deprecated public double getT1()
getT1
in interface Curve2D
public Point2D point(double t)
Curve2D
point
in interface Curve2D
public LineSegment2D reverse()
reverse
in interface CirculinearContinuousCurve2D
reverse
in interface CirculinearCurve2D
reverse
in interface CirculinearElement2D
reverse
in interface ContinuousCurve2D
reverse
in interface Curve2D
reverse
in interface SmoothCurve2D
reverse
in interface ContinuousOrientedCurve2D
reverse
in interface OrientedCurve2D
reverse
in interface SmoothOrientedCurve2D
public boolean isBounded()
isBounded
in interface Shape2D
public boolean contains(double xp, double yp)
Shape2D
contains
in interface Shape2D
public double distance(double x, double y)
distance
in interface Shape2D
distance
in class AbstractLine2D
x
- the x-coordinate of the pointy
- the 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 LinearElement2D
transform
in interface LinearShape2D
transform
in interface Shape2D
transform
in class AbstractLine2D
trans
- an affine transform
public Box2D boundingBox()
boundingBox
in interface Shape2D
public java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
appendPath
in interface ContinuousCurve2D
path
- the path to modify
public java.awt.geom.GeneralPath getGeneralPath()
public boolean almostEquals(GeometricObject2D obj, double eps)
GeometricObject2D
almostEquals
in interface GeometricObject2D
obj
- the object to compareeps
- a threshold value, for example the minimal coordinate difference
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.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 |