math.geom2d.line
Class LineSegment2D
java.lang.Object
math.geom2d.line.StraightObject2D
math.geom2d.line.LineArc2D
math.geom2d.line.LineSegment2D
- All Implemented Interfaces:
- java.awt.Shape, ContinuousCurve2D, ContinuousOrientedCurve2D, Curve2D, OrientedCurve2D, SmoothCurve2D, SmoothOrientedCurve2D, Shape2D
public class LineSegment2D
- extends LineArc2D
Straight Edge defined by two points.
|
Constructor Summary |
LineSegment2D(double x1,
double y1,
double x2,
double y2)
Define a new Edge with two extremities. |
LineSegment2D(java.awt.geom.Point2D point1,
java.awt.geom.Point2D point2)
Define a new Edge with two extremities. |
| Methods inherited from class math.geom2d.line.LineArc2D |
appendPath, clip, contains, contains, equals, equals, getAsPolyline, getBoundingBox, getBounds, getBounds2D, getContinuousCurves, getCurvature, getDistance, getDistance, getFirstPoint, getInnerPath, getLastPoint, getLength, getPathIterator, getPathIterator, getPoint, getPoint, getPoint1, getPoint2, getPosition, getSmoothPieces, getSubCurve, getT0, getT1, getTangent, getWindingAngle, getX1, getX2, getY1, getY2, intersects, intersects, isBounded, isInside, project, toString |
| Methods inherited from class math.geom2d.line.StraightObject2D |
contains, contains, getCartesianEquation, getDistance, getHorizontalAngle, getIntersection, getIntersection, getIntersections, getOrigin, getParallel, getParametric, getPerpendicular, getPolarCoefficients, getPositionOnLine, getPositionOnLine, getProjectedPoint, getProjectedPoint, getSignedDistance, getSignedDistance, getSignedPolarCoefficients, getSupportLine, getSymmetric, getSymmetric, getVector, isClosed, isColinear, isColinear, isInside, isParallel, isParallel |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.Shape |
contains, contains |
LineSegment2D
public LineSegment2D(java.awt.geom.Point2D point1,
java.awt.geom.Point2D point2)
- Define a new Edge with two extremities.
LineSegment2D
public LineSegment2D(double x1,
double y1,
double x2,
double y2)
- Define a new Edge with two extremities.
getMedian
public static final StraightLine2D getMedian(LineSegment2D edge)
getEdgeAngle
public static final double getEdgeAngle(LineSegment2D edge1,
LineSegment2D edge2)
- Returns angle between two edges sharing one vertex.
getOtherPoint
public Point2D getOtherPoint(Point2D point)
- Return the opposite vertex of the edge.
- Parameters:
point - : one of the vertices of the edge
- Returns:
- the other vertex
setLineSegment
public void setLineSegment(Point2D p1,
Point2D p2)
setLineSegment
public void setLineSegment(double x1,
double y1,
double x2,
double y2)
getReverseCurve
public 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.
- Specified by:
getReverseCurve in interface ContinuousCurve2D- Specified by:
getReverseCurve in interface ContinuousOrientedCurve2D- Specified by:
getReverseCurve in interface Curve2D- Specified by:
getReverseCurve in interface OrientedCurve2D- Specified by:
getReverseCurve in interface SmoothCurve2D- Specified by:
getReverseCurve in interface SmoothOrientedCurve2D- Overrides:
getReverseCurve in class LineArc2D
getMedian
public StraightLine2D getMedian()
- Return the median of the edge, that is the locus of points located at equal
distance of each vertex.
transform
public LineSegment2D transform(AffineTransform2D trans)
- Description copied from interface:
Curve2D
- Transforms the curve by an affine transform. The result is an instance
of Curve2D.
- Specified by:
transform in interface ContinuousCurve2D- Specified by:
transform in interface ContinuousOrientedCurve2D- Specified by:
transform in interface Curve2D- Specified by:
transform in interface OrientedCurve2D- Specified by:
transform in interface SmoothCurve2D- Specified by:
transform in interface SmoothOrientedCurve2D- Specified by:
transform in interface Shape2D- Overrides:
transform in class LineArc2D
- Parameters:
trans - an affine transform
- Returns:
- the transformed shape