|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.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 CirculinearCurve2Dlength in class AbstractLine2Dpublic 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 CirculinearContinuousCurve2Dparallel in interface CirculinearCurve2Dparallel in interface CirculinearElement2Dd - the distance between the original curve and he parallel curve.
public double signedDistance(double x,
double y)
AbstractLine2D
signedDistance in interface OrientedCurve2DsignedDistance in class AbstractLine2Dx - x-coord of a pointy - y-coord of a point
public Point2D firstPoint()
firstPoint in interface Curve2DfirstPoint in class AbstractContinuousCurve2DCurve2D.t0(),
Curve2D.point(double)public Point2D lastPoint()
lastPoint in interface Curve2DlastPoint in class AbstractContinuousCurve2DCurve2D.t1(),
Curve2D.point(double)public double t0()
t0 in interface Curve2D@Deprecated public double getT0()
getT0 in interface Curve2Dpublic double t1()
t1 in interface Curve2D@Deprecated public double getT1()
getT1 in interface Curve2Dpublic Point2D point(double t)
Curve2D
point in interface Curve2Dpublic LineSegment2D reverse()
reverse in interface CirculinearContinuousCurve2Dreverse in interface CirculinearCurve2Dreverse in interface CirculinearElement2Dreverse in interface ContinuousCurve2Dreverse in interface Curve2Dreverse in interface SmoothCurve2Dreverse in interface ContinuousOrientedCurve2Dreverse in interface OrientedCurve2Dreverse in interface SmoothOrientedCurve2Dpublic 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 Shape2Ddistance in class AbstractLine2Dx - the x-coordinate of the pointy - the y-coordinate of the point
public LineSegment2D transform(AffineTransform2D trans)
Curve2D
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface SmoothCurve2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface OrientedCurve2Dtransform in interface SmoothOrientedCurve2Dtransform in interface LinearElement2Dtransform in interface LinearShape2Dtransform in interface Shape2Dtransform in class AbstractLine2Dtrans - an affine transform
public Box2D boundingBox()
boundingBox in interface Shape2Dpublic java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
appendPath in interface ContinuousCurve2Dpath - the path to modify
public java.awt.geom.GeneralPath getGeneralPath()
public boolean almostEquals(GeometricObject2D obj,
double eps)
GeometricObject2D
almostEquals in interface GeometricObject2Dobj - the object to compareeps - a threshold value, for example the minimal coordinate difference
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic LineSegment2D clone()
AbstractLine2D
clone in interface Curve2Dclone in class AbstractLine2D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||