|
||||||||||
| 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.StraightLine2D
public class StraightLine2D
Implementation of a straight line. Such a line can be constructed using two points, a point and a parallel line or straight object, or with coefficient of the Cartesian equation.
| Field Summary |
|---|
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
StraightLine2D()
Empty constructor: a straight line corresponding to horizontal axis. |
|
StraightLine2D(double a,
double b,
double c)
Defines a new straight line, from the coefficients of the cartesian equation. |
|
StraightLine2D(double xp,
double yp,
double dx,
double dy)
Defines a new Straight line going through the point (xp, yp) and with the direction dx, dy. |
|
StraightLine2D(LinearShape2D line)
Defines a new Straight line at the same position and with the same direction than an other straight object (line, edge or ray). |
|
StraightLine2D(LinearShape2D line,
Point2D point)
Defines a new Straight line, parallel to another straigth object (ray, straight line or edge), and going through the given point. |
|
StraightLine2D(Point2D point,
double angle)
Defines a new Straight line going through the given point, and with the specified direction given by angle. |
|
StraightLine2D(Point2D point,
double dx,
double dy)
Defines a new Straight line going through the given point, and with the specified direction vector. |
|
StraightLine2D(Point2D point1,
Point2D point2)
Defines a new Straight line going through the two given points. |
|
StraightLine2D(Point2D point,
Vector2D direction)
Defines a new Straight line going through the given point, and with the specified direction vector. |
|
| 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)
Append the path of the curve to the given path. |
Polyline2D |
asPolyline(int n)
Throws an exception when called. |
Box2D |
boundingBox()
Returns the bounding box of the shape. |
StraightLine2D |
clone()
Ensures public declaration of clone(), and ensures valid return type. |
boolean |
contains(double x,
double y)
Returns true if the point (x, y) lies on the line, with precision given by Shape2D.ACCURACY. |
boolean |
contains(Point2D p)
Returns true if the point p lies on the line, with precision given by Shape2D.ACCURACY. |
java.util.Collection<? extends StraightLine2D> |
continuousCurves()
Need to override to cast the type. |
static StraightLine2D |
create(Point2D point,
double angle)
Deprecated. since 0.11.1 |
static StraightLine2D |
create(Point2D p1,
Point2D p2)
Deprecated. since 0.11.1 |
static StraightLine2D |
create(Point2D origin,
Vector2D direction)
Deprecated. since 0.11.1 |
static StraightLine2D |
createCartesian(double a,
double b,
double c)
Returns a new Straight line, with the given coefficient of the cartesian equation (a*x + b*y + c = 0). |
static StraightLine2D |
createHorizontal(Point2D origin)
Creates a vertical straight line through the given point. |
static StraightLine2D |
createMedian(Point2D p1,
Point2D p2)
Creates a median between 2 points. |
static StraightLine2D |
createParallel(LinearShape2D linear,
double d)
Returns a new Straight line, parallel to another straight object (ray, straight line or edge), and going through the given point. |
static StraightLine2D |
createParallel(LinearShape2D line,
Point2D point)
Returns a new Straight line, parallel to another straight object (ray, straight line or edge), and going through the given point. |
static StraightLine2D |
createPerpendicular(LinearShape2D linear,
Point2D point)
Returns a new Straight line, perpendicular to a straight object (ray, straight line or edge), and going through the given point. |
static StraightLine2D |
createVertical(Point2D origin)
Creates a vertical straight line through the given point. |
double |
distance(double x,
double y)
Returns the distance of the point (x, y) to this straight line. |
CirculinearDomain2D |
domain()
Returns the domain delimited by this boundary. |
boolean |
equals(java.lang.Object obj)
|
void |
fill(java.awt.Graphics2D g2)
Fills the interior of the boundary, using the Graphics current Paint. |
Point2D |
firstPoint()
Throws an infiniteShapeException |
java.awt.geom.GeneralPath |
getGeneralPath()
Throws an infiniteShapeException |
static Point2D |
getIntersection(Point2D p1,
Point2D p2,
Point2D p3,
Point2D p4)
Computes the intersection point of the two (infinite) lines going through p1 and p2 for the first one, and p3 and p4 for the second one. |
double |
getT0()
Deprecated. replaced by t0() (since 0.11.1). |
double |
getT1()
Deprecated. replaced by t1() (since 0.11.1). |
boolean |
isBounded()
Always returns false, because a line is not bounded. |
boolean |
isSingular(double pos)
Returns false, whatever the position. |
Point2D |
lastPoint()
Throws an infiniteShapeException |
StraightLine2D |
parallel(double d)
Returns the parallel line located at a distance d from the line. |
StraightLine2D |
parallel(Point2D point)
Returns a new Straight line, parallel to another straight object (ray, straight line or edge), and going through the given point. |
StraightLine2D |
perpendicular(Point2D point)
Returns a new Straight line, parallel to another straight object (ray, straight line or edge), and going through the given point. |
Point2D |
point(double t)
Returns the point specified with the parametric representation of the line. |
StraightLine2D |
reverse()
Returns the straight line with same origin but with opposite direction vector. |
java.util.Collection<Point2D> |
singularPoints()
Returns an empty list of points. |
double |
t0()
Returns the parameter of the first point of the line, which is always Double.NEGATIVE_INFINITY. |
double |
t1()
Returns the parameter of the last point of the line, which is always Double.POSITIVE_INFINITY. |
java.lang.String |
toString()
|
StraightLine2D |
transform(AffineTransform2D trans)
Returns the transformed line. |
CircleLine2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion. |
double |
windingAngle(Point2D point)
Return the angle portion that the curve turn around the given point. |
| Methods inherited from class math.geom2d.line.AbstractLine2D |
|---|
buffer, cartesianEquation, clip, curvature, direction, distance, getIntersection, getSymmetric, getSymmetric, horizontalAngle, intersection, intersections, isClosed, isColinear, isColinear, isEmpty, isInside, isParallel, isParallel, length, length, origin, parametric, polarCoefficients, polarCoefficientsSigned, position, position, positionOnLine, positionOnLine, project, projectedPoint, projectedPoint, signedDistance, signedDistance, smoothPieces, subCurve, supportingLine, tangent |
| Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D |
|---|
leftTangent, normal, rightTangent, vertices |
| Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
|---|
asAwtShape, 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 |
| Methods inherited from interface math.geom2d.circulinear.CirculinearContinuousCurve2D |
|---|
smoothPieces |
| Methods inherited from interface math.geom2d.circulinear.CirculinearCurve2D |
|---|
length, 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.domain.Boundary2D |
|---|
isInside |
| Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
curvature, isClosed, leftTangent, rightTangent |
| Methods inherited from interface math.geom2d.domain.OrientedCurve2D |
|---|
signedDistance, signedDistance |
| Methods inherited from interface math.geom2d.curve.Curve2D |
|---|
asAwtShape, draw, intersections, position, project, vertices |
| Methods inherited from interface math.geom2d.Shape2D |
|---|
distance, isEmpty |
| Constructor Detail |
|---|
public StraightLine2D()
public StraightLine2D(Point2D point1,
Point2D point2)
public StraightLine2D(Point2D point,
Vector2D direction)
public StraightLine2D(Point2D point,
double dx,
double dy)
public StraightLine2D(Point2D point,
double angle)
public StraightLine2D(LinearShape2D line)
public StraightLine2D(double xp,
double yp,
double dx,
double dy)
public StraightLine2D(LinearShape2D line,
Point2D point)
public StraightLine2D(double a,
double b,
double c)
| Method Detail |
|---|
@Deprecated
public static StraightLine2D create(Point2D point,
double angle)
@Deprecated
public static StraightLine2D create(Point2D p1,
Point2D p2)
@Deprecated
public static StraightLine2D create(Point2D origin,
Vector2D direction)
public static StraightLine2D createHorizontal(Point2D origin)
public static StraightLine2D createVertical(Point2D origin)
public static StraightLine2D createMedian(Point2D p1,
Point2D p2)
p1 - one pointp2 - another point
public static StraightLine2D createParallel(LinearShape2D line,
Point2D point)
public static StraightLine2D createParallel(LinearShape2D linear,
double d)
public static StraightLine2D createPerpendicular(LinearShape2D linear,
Point2D point)
public static StraightLine2D createCartesian(double a,
double b,
double c)
public static Point2D getIntersection(Point2D p1,
Point2D p2,
Point2D p3,
Point2D p4)
public StraightLine2D parallel(Point2D point)
parallel in class AbstractLine2Dpoint - the point to go through
public StraightLine2D parallel(double d)
parallel in interface CircleLine2Dparallel in interface CirculinearBoundary2Dparallel in interface CirculinearContinuousCurve2Dparallel in interface CirculinearContour2Dparallel in interface CirculinearCurve2Dparallel in interface CirculinearElement2Dd - the distance between the original curve and he parallel curve.
DegeneratedLine2DException - if line direction vector is nullpublic StraightLine2D perpendicular(Point2D point)
perpendicular in class AbstractLine2Dpoint - the point to go through
public CircleLine2D transform(CircleInversion2D inv)
CirculinearShape2D
transform in interface CircleLine2Dtransform in interface CirculinearBoundary2Dtransform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearContour2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearElement2Dtransform in interface CirculinearShape2Dtransform in class AbstractLine2Dinv - the circle inversion
public CirculinearDomain2D domain()
Boundary2D
domain in interface CirculinearBoundary2Ddomain in interface Boundary2Dpublic void fill(java.awt.Graphics2D g2)
Boundary2D
fill in interface Boundary2Dg2 - the Graphics to fill onpublic double windingAngle(Point2D point)
OrientedCurve2D
windingAngle in interface OrientedCurve2DwindingAngle in class AbstractLine2Dpoint - a point of the plane
public Polyline2D asPolyline(int n)
asPolyline in interface ContinuousCurve2DasPolyline in class AbstractContinuousCurve2Dn - the number of line segments
n line segments.ContinuousCurve2D.asPolyline(int)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 java.util.Collection<Point2D> singularPoints()
singularPoints in interface Curve2DsingularPoints in class AbstractSmoothCurve2DCurve2D.singularPoints()public boolean isSingular(double pos)
isSingular in interface Curve2DisSingular in class AbstractSmoothCurve2Dpos - the position of the point on the curve
Curve2D.isSingular(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)
point in interface Curve2Dpublic java.util.Collection<? extends StraightLine2D> continuousCurves()
continuousCurves in interface CirculinearBoundary2DcontinuousCurves in interface CirculinearCurve2DcontinuousCurves in interface Curve2DcontinuousCurves in interface Boundary2DcontinuousCurves in class AbstractLine2Dpublic StraightLine2D reverse()
reverse in interface CircleLine2Dreverse in interface CirculinearBoundary2Dreverse in interface CirculinearContinuousCurve2Dreverse in interface CirculinearContour2Dreverse in interface CirculinearCurve2Dreverse in interface CirculinearElement2Dreverse in interface ContinuousCurve2Dreverse in interface Curve2Dreverse in interface SmoothCurve2Dreverse in interface Boundary2Dreverse in interface ContinuousOrientedCurve2Dreverse in interface Contour2Dreverse in interface OrientedCurve2Dreverse in interface SmoothContour2Dreverse in interface SmoothOrientedCurve2Dpublic java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
ContinuousCurve2D
appendPath in interface ContinuousCurve2Dpath - a path to modify
public boolean isBounded()
isBounded 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 Box2D boundingBox()
Shape2D
boundingBox in interface Shape2Dpublic StraightLine2D transform(AffineTransform2D trans)
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface SmoothCurve2Dtransform in interface Boundary2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface Contour2Dtransform in interface OrientedCurve2Dtransform in interface SmoothContour2Dtransform in interface SmoothOrientedCurve2Dtransform in interface LinearElement2Dtransform in interface LinearShape2Dtransform in interface Shape2Dtransform in class AbstractLine2Dtrans - an affine transform
public boolean contains(double x,
double y)
contains in interface Shape2Dpublic boolean contains(Point2D p)
contains in interface Shape2Dcontains in class AbstractLine2Dpublic 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 StraightLine2D 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 | |||||||||