public class RMLine
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
double |
_epx |
double |
_epy |
double |
_spx |
double |
_spy |
Constructor and Description |
---|
RMLine()
Creates a new line.
|
RMLine(double x1,
double y1,
double x2,
double y2)
Creates a new line for the given x & y start/end points.
|
RMLine(Point sp,
Point ep)
Creates a new line for the given start point and end point.
|
Modifier and Type | Method and Description |
---|---|
RMLine |
clone()
Standard clone implementation.
|
double |
getAngle(double t)
Returns the angle at given parametric point (in degrees).
|
Rect |
getBounds()
Returns the bounds of the line.
|
void |
getBounds(Rect aRect)
Get bounds of line in given rect.
|
double |
getDistance(double aX,
double aY)
Returns the minimum distance from the given point to this segment.
|
double |
getDistanceLine(double aX,
double aY)
Returns the minimum distance from the given point to this line.
|
double |
getDistanceLineSquared(double anX,
double aY)
Returns the minimum distance from the given point to this line, squared.
|
static double |
getDistanceLineSquared(double p0x,
double p0y,
double p1x,
double p1y,
double p2x,
double p2y)
Returns the distance from the given point components (p0) to the given line components (p1->p2).
|
Point |
getEP()
Returns the end point.
|
double |
getEPx()
Returns the end point x.
|
double |
getEPy()
Returns the end point y.
|
RMLine |
getHead(double t)
Returns a new line from this line's start point to given parametric location t (defined from 0-1) on this line.
|
RMHitInfo |
getHitInfo(RMBezier aBezier)
Returns a hit info object for this line and the given bezier.
|
RMHitInfo |
getHitInfo(RMLine aLine)
Returns a hit info object for this line and the given line.
|
RMHitInfo |
getHitInfo(RMQuadratic aCurve)
Returns a hit info object for this line and the given bezier curve.
|
double |
getLastX()
Returns the last x.
|
double |
getLastY()
Returns the last y.
|
double |
getMaxX()
Returns the max x point of this line.
|
double |
getMaxY()
Returns the max y point of this line.
|
double |
getMinX()
Returns the min x point of this line.
|
double |
getMinY()
Returns the min y point of this line.
|
Point |
getPoint(double t)
Returns the point on this line at the parametric location t (defined from 0-1).
|
Point |
getPoint(double t,
Point aPoint)
Returns the point on this line at the parametric location t (defined from 0-1).
|
int |
getPointCount()
Returns the point count of segment.
|
double |
getPointX(int anIndex)
Returns the x of point at given index.
|
double |
getPointY(int anIndex)
Returns the y of point at given index.
|
Point |
getSP()
Returns the start point.
|
double |
getSPx()
Returns the start point x.
|
double |
getSPy()
Returns the start point y.
|
RMLine |
getTail(double t)
Returns a new line from given parametric location t (defined from 0-1) on this line to this line's end point.
|
double |
getTangent(double t,
Size tan)
Return the tangent at given point.
|
void |
setEnd(double t)
Reset this curve's end point to the given parametric location (0-1).
|
void |
setStart(double t)
Reset this curve's start point to the given parametric location (0-1).
|
java.lang.String |
toString()
Returns a string representation of this line.
|
public double _spx
public double _spy
public double _epx
public double _epy
public RMLine()
public RMLine(double x1, double y1, double x2, double y2)
public RMLine(Point sp, Point ep)
public double getSPx()
public double getSPy()
public Point getSP()
public double getEPx()
public double getEPy()
public Point getEP()
public final Point getPoint(double t)
public Point getPoint(double t, Point aPoint)
public int getPointCount()
public double getPointX(int anIndex)
public double getPointY(int anIndex)
public double getLastX()
public double getLastY()
public double getDistance(double aX, double aY)
public double getDistanceLine(double aX, double aY)
public double getDistanceLineSquared(double anX, double aY)
public static double getDistanceLineSquared(double p0x, double p0y, double p1x, double p1y, double p2x, double p2y)
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
public final Rect getBounds()
public void getBounds(Rect aRect)
public RMLine getHead(double t)
public RMLine getTail(double t)
public void setEnd(double t)
public void setStart(double t)
public RMHitInfo getHitInfo(RMLine aLine)
public RMHitInfo getHitInfo(RMQuadratic aCurve)
public RMHitInfo getHitInfo(RMBezier aBezier)
public java.lang.String toString()
toString
in class java.lang.Object
public double getAngle(double t)
public double getTangent(double t, Size tan)
public RMLine clone()
clone
in class java.lang.Object