public class StraightLine2D extends AbstractLine2D implements SmoothBoundary2D, Cloneable, CircleLine2D
dx, dy, x0, y0| Constructor and Description |
|---|
StraightLine2D()
Empty constructor: a straight line corresponding to horizontal axis.
|
StraightLine2D(double a,
double b,
double c)
Define a new straight line, from the coefficients of the cartesian
equation.
|
StraightLine2D(double xp,
double yp,
double dx,
double dy)
Define a new Straight line going through the point (xp, yp) and with the
direction dx, dy.
|
StraightLine2D(LinearShape2D line)
Define 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)
Define 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)
Define a new Straight line going through the given point, and with the
specified direction given by angle.
|
StraightLine2D(Point2D point,
double dx,
double dy)
Define a new Straight line going through the given point, and with the
specified direction vector.
|
StraightLine2D(Point2D point1,
Point2D point2)
Define a new Straight line going through the two given points.
|
StraightLine2D(Point2D point,
Vector2D direction)
Define a new Straight line going through the given point, and with the
specified direction vector.
|
| Modifier and Type | Method and Description |
|---|---|
GeneralPath |
appendPath(GeneralPath path)
Append the path of the curve to the given path.
|
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.
|
static StraightLine2D |
create(Point2D point,
double angle)
Creates a straight line going through a point and with a given angle.
|
static StraightLine2D |
create(Point2D p1,
Point2D p2)
Creates a straight line through 2 points.
|
static StraightLine2D |
create(Point2D origin,
Vector2D direction)
Creates a straight line through a point and with a given direction
vector.
|
static StraightLine2D |
createCartesian(double a,
double b,
double c)
Return a new Straight line, with the given coefficient of the cartesian
equation (a*x + b*y + c = 0).
|
static StraightLine2D |
createCartesianLine2D(double a,
double b,
double c)
Deprecated.
since 0.6.3, use createCartesian instead
|
static StraightLine2D |
createMedian(Point2D p1,
Point2D p2)
Creates a median between 2 points.
|
static StraightLine2D |
createMedian2D(Point2D p1,
Point2D p2)
Deprecated.
since 0.6.3, use createMedian instead
|
static StraightLine2D |
createOrthogonalLine2D(LinearShape2D linear,
Point2D point)
Deprecated.
since 0.6.3, use createPerpendicular instead
|
static StraightLine2D |
createParallel(LinearShape2D linear,
double d)
Return 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)
Return a new Straight line, parallel to another straight object (ray,
straight line or edge), and going through the given point.
|
static StraightLine2D |
createParallelLine2D(LinearShape2D linear,
double d)
Deprecated.
since 0.6.3, use createParallel() instead
|
static StraightLine2D |
createParallelLine2D(LinearShape2D line,
Point2D point)
Deprecated.
since 0.6.3, use createParallel() instead
|
static StraightLine2D |
createPerpendicular(LinearShape2D linear,
Point2D point)
Return a new Straight line, perpendicular to a straight object (ray,
straight line or edge), and going through the given point.
|
static StraightLine2D |
createStraightLine2D(Point2D point,
double dx,
double dy)
Deprecated.
since 0.6.3, use create() instead
|
static StraightLine2D |
createStraightLine2D(Point2D p1,
Point2D p2)
Deprecated.
use create(Point2D, Point2D) instead
|
boolean |
equals(Object obj) |
void |
fill(Graphics2D g2) |
Polyline2D |
getAsPolyline(int n)
Throws an exception when called.
|
Collection<ContinuousBoundary2D> |
getBoundaryCurves()
Returns the different continuous curves composing the boundary
|
Box2D |
getBoundingBox()
Returns the bounding box of the shape.
|
Collection<? extends StraightLine2D> |
getContinuousCurves()
Need to override to cast the type.
|
double |
getDistance(double x,
double y)
Returns the distance of the point (x, y) to this straight line.
|
Domain2D |
getDomain()
Returns the domain delimited by this boundary.
|
Point2D |
getFirstPoint()
Throws an infiniteShapeException
|
GeneralPath |
getGeneralPath()
Throws an infiniteShapeException
|
static Point2D |
getIntersection(Point2D p1,
Point2D p2,
Point2D p3,
Point2D p4)
Compute 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.
|
Point2D |
getLastPoint()
Throws an infiniteShapeException
|
StraightLine2D |
getParallel(double d)
Return the parallel line located at a distance d.
|
StraightLine2D |
getParallel(Point2D point)
Returns a new Straight line, parallel to another straight object (ray,
straight line or edge), and going through the given point.
|
StraightLine2D |
getPerpendicular(Point2D point)
Return a new Straight line, parallel to another straigth object (ray,
straight line or edge), and going through the given point.
|
Point2D |
getPoint(double t)
Gets the point specified with the parametric representation of the line.
|
StraightLine2D |
getReverseCurve()
Returns the straight line with same origin but with opposite direction
vector.
|
Collection<Point2D> |
getSingularPoints()
Returns an empty list of points.
|
double |
getT0()
Returns the parameter of the first point of the line, which is always
Double.NEGATIVE_INFINITY.
|
double |
getT1()
Returns the parameter of the last point of the line, which is always
Double.POSITIVE_INFINITY.
|
double |
getWindingAngle(Point2D point)
Return the angle portion that the curve turn around the given point.
|
boolean |
isBounded()
Always returns false, because a line is not bounded.
|
boolean |
isSingular(double pos)
Returns false, whatever the position.
|
void |
setCartesianEquation(double a,
double b,
double c)
Deprecated.
lines will become imutable in a future release
|
void |
setLine(double x0,
double y0,
double dx,
double dy)
Deprecated.
lines will become imutable in a future release
|
void |
setLine(LinearShape2D linear)
Deprecated.
lines will become imutable in a future release
|
void |
setLine(Point2D p1,
Point2D p2)
Deprecated.
lines will become imutable in a future release
|
void |
setPoints(double x1,
double y1,
double x2,
double y2)
Deprecated.
lines will become imutable in a future release
|
String |
toString() |
StraightLine2D |
transform(AffineTransform2D trans)
Returns the transformed line.
|
CircleLine2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion.
|
clip, getBuffer, getCartesianEquation, getCurvature, getDistance, getHorizontalAngle, getIntersection, getIntersection, getIntersections, getLength, getLength, getOrigin, getParallel, getParametric, getPolarCoefficients, getPosition, getPosition, getPositionOnLine, getPositionOnLine, getProjectedPoint, getProjectedPoint, getSignedDistance, getSignedDistance, getSignedPolarCoefficients, getSmoothPieces, getSubCurve, getSupportingLine, getSymmetric, getSymmetric, getTangent, getVector, isClosed, isColinear, isColinear, isEmpty, isInside, isParallel, isParallel, project, supportContainsgetLeftTangent, getRightTangentdraw, getAsAWTShape, wrapCurvefinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclip, getSubCurvegetSmoothPiecesgetLeftTangent, getRightTangent, isCloseddraw, getAsAWTShape, getIntersections, getPosition, projectgetDistance, isEmptygetCurvature, getTangentisInsidepublic 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)
public static final StraightLine2D create(Point2D point, double angle)
public static final StraightLine2D create(Point2D p1, Point2D p2)
public static final StraightLine2D create(Point2D origin, Vector2D direction)
@Deprecated public static final StraightLine2D createStraightLine2D(Point2D p1, Point2D p2)
public static final StraightLine2D createMedian(Point2D p1, Point2D p2)
p1 - one pointp2 - another point@Deprecated public static final StraightLine2D createMedian2D(Point2D p1, Point2D p2)
p1 - one pointp2 - another point@Deprecated public static final StraightLine2D createStraightLine2D(Point2D point, double dx, double dy)
public static final StraightLine2D createParallel(LinearShape2D line, Point2D point)
@Deprecated public static final StraightLine2D createParallelLine2D(LinearShape2D line, Point2D point)
public static final StraightLine2D createParallel(LinearShape2D linear, double d)
@Deprecated public static final StraightLine2D createParallelLine2D(LinearShape2D linear, double d)
public static final StraightLine2D createPerpendicular(LinearShape2D linear, Point2D point)
@Deprecated public static final StraightLine2D createOrthogonalLine2D(LinearShape2D linear, Point2D point)
public static final StraightLine2D createCartesian(double a, double b, double c)
@Deprecated public static final StraightLine2D createCartesianLine2D(double a, double b, double c)
public static final Point2D getIntersection(Point2D p1, Point2D p2, Point2D p3, Point2D p4)
@Deprecated public void setLine(double x0, double y0, double dx, double dy)
@Deprecated public void setPoints(double x1, double y1, double x2, double y2)
@Deprecated public void setLine(Point2D p1, Point2D p2)
@Deprecated public void setLine(LinearShape2D linear)
@Deprecated public void setCartesianEquation(double a, double b, double c)
public StraightLine2D getParallel(Point2D point)
public StraightLine2D getParallel(double d)
getParallel in interface CircleLine2DgetParallel in interface CirculinearContinuousCurve2DgetParallel in interface CirculinearContour2DgetParallel in interface CirculinearCurve2DgetParallel in interface CirculinearElement2DgetParallel in interface ContinuousCirculinearCurve2Dd - the distance between the original curve and he parallel curve.public StraightLine2D getPerpendicular(Point2D point)
getPerpendicular in class AbstractLine2Dpoint - the point to go throughpublic CircleLine2D transform(CircleInversion2D inv)
CirculinearShape2Dtransform in interface CircleLine2Dtransform in interface CirculinearBoundary2Dtransform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearContour2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearElement2Dtransform in interface CirculinearShape2Dtransform in interface ContinuousCirculinearCurve2Dtransform in class AbstractLine2Dinv - the circle inversionpublic Collection<ContinuousBoundary2D> getBoundaryCurves()
Boundary2DgetBoundaryCurves in interface Boundary2Dpublic Domain2D getDomain()
Boundary2DgetDomain in interface Boundary2Dpublic void fill(Graphics2D g2)
fill in interface Boundary2Dpublic double getWindingAngle(Point2D point)
OrientedCurve2DgetWindingAngle in interface OrientedCurve2DgetWindingAngle in class AbstractLine2Dpoint - a point of the planepublic Polyline2D getAsPolyline(int n)
getAsPolyline in interface ContinuousCurve2DgetAsPolyline in class AbstractContinuousCurve2Dn - the number of line segmentsn line segments.public Point2D getFirstPoint()
getFirstPoint in interface Curve2DgetFirstPoint in class AbstractContinuousCurve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class AbstractContinuousCurve2Dpublic Collection<Point2D> getSingularPoints()
getSingularPoints in interface Curve2DgetSingularPoints in class AbstractSmoothCurve2DCurve2D.getSingularPoints()public boolean isSingular(double pos)
isSingular in interface Curve2DisSingular in class AbstractSmoothCurve2Dpos - the position of the point on the curveCurve2D.isSingular(double)public double getT0()
public double getT1()
public Point2D getPoint(double t)
public Collection<? extends StraightLine2D> getContinuousCurves()
getContinuousCurves in interface CirculinearBoundary2DgetContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class AbstractLine2Dpublic StraightLine2D getReverseCurve()
getReverseCurve in interface CircleLine2DgetReverseCurve in interface CirculinearBoundary2DgetReverseCurve in interface CirculinearContinuousCurve2DgetReverseCurve in interface CirculinearContour2DgetReverseCurve in interface CirculinearCurve2DgetReverseCurve in interface CirculinearElement2DgetReverseCurve in interface ContinuousCirculinearCurve2DgetReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface SmoothCurve2DgetReverseCurve in interface Boundary2DgetReverseCurve in interface ContinuousBoundary2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface OrientedCurve2DgetReverseCurve in interface SmoothBoundary2DgetReverseCurve in interface SmoothOrientedCurve2Dpublic GeneralPath appendPath(GeneralPath path)
ContinuousCurve2DappendPath in interface ContinuousCurve2Dpath - a path to modifypublic boolean isBounded()
public double getDistance(double x,
double y)
getDistance in interface Shape2DgetDistance in class AbstractLine2Dx - x-coordinate of the pointy - y-coordinate of the pointpublic Box2D getBoundingBox()
Shape2DgetBoundingBox in interface Shape2Dpublic StraightLine2D transform(AffineTransform2D trans)
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface SmoothCurve2Dtransform in interface Boundary2Dtransform in interface ContinuousBoundary2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface OrientedCurve2Dtransform in interface SmoothBoundary2Dtransform in interface SmoothOrientedCurve2Dtransform in interface LinearShape2Dtransform in interface Shape2Dtransform in class AbstractLine2Dtrans - an affine transformpublic boolean contains(double x,
double y)
public boolean contains(Point2D p)
contains in interface Shape2Dcontains in class AbstractLine2Dpublic GeneralPath getGeneralPath()
public StraightLine2D clone()
AbstractLine2Dclone in interface Curve2Dclone in class AbstractLine2DCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.