Package georegression.struct.line
Class LineParametric2D_F64
java.lang.Object
georegression.struct.line.LineParametric2D_F64
- All Implemented Interfaces:
Serializable
2D line parameterized using parametric equation:
[x, y] = [x_0, y_0] + t·[slopeX, slopeY]
where t specifies the location along the line, (x_0,y_0) is an arbitrary point on the line,
and (slopeX,slopeY).
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionA point on the lineThe line's slope -
Constructor Summary
ConstructorDescriptionLineParametric2D_F64
(double x_0, double y_0, double slopeX, double slopeY) Creates a line defined from two points.LineParametric2D_F64
(Point2D_F64 p, Vector2D_F64 slope) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
boolean
double
getAngle()
getPoint()
getPointOnLine
(double t) Returns a point along the line.void
getPointOnLine
(double t, Point2D_F64 x) final double
final double
final double
getX()
final double
getY()
int
hashCode()
void
setAngle
(double angle) Sets the slope to the unit vector specified by the provided angle.void
setPoint
(double x, double y) void
setPoint
(Point2D_F64 pt) void
setSlope
(double slopeX, double slopeY) void
setSlope
(Vector2D_F64 slope) setTo
(LineParametric2D_F64 line) toString()
void
zero()
-
Field Details
-
p
A point on the line -
slope
The line's slope
-
-
Constructor Details
-
LineParametric2D_F64
public LineParametric2D_F64(double x_0, double y_0, double slopeX, double slopeY) -
LineParametric2D_F64
-
LineParametric2D_F64
Creates a line defined from two points. The slope will be in the direction from a to b.- Parameters:
a
- point on lineb
- point on line which isn't a- See Also:
-
LineParametric2D_F64
public LineParametric2D_F64()
-
-
Method Details
-
setTo
-
zero
public void zero() -
setPoint
-
setPoint
public void setPoint(double x, double y) -
setSlope
-
setSlope
public void setSlope(double slopeX, double slopeY) -
setAngle
public void setAngle(double angle) Sets the slope to the unit vector specified by the provided angle.- Parameters:
angle
- Angle of the line specified in radians.
-
getAngle
public double getAngle() -
getPointOnLine
Returns a point along the line. See parametric equation in class description.- Parameters:
t
- Location along the line.- Returns:
- Point on the line.
-
getPointOnLine
-
getPoint
-
getSlopeX
public final double getSlopeX() -
getSlopeY
public final double getSlopeY() -
getX
public final double getX() -
getY
public final double getY() -
copy
-
toString
-
equals
-
hashCode
public int hashCode()
-