public class Line2D extends Object
Modifier and Type | Field and Description |
---|---|
private double |
a |
private double |
b |
private double |
c |
private double |
kx |
private double |
ky |
private double |
nx |
private double |
ny |
private double |
x1 |
private double |
x2 |
private double |
y1 |
private double |
y2 |
Constructor and Description |
---|
Line2D(double x1,
double y1,
double x2,
double y2)
Line computed from two points
Normal and directional vector are computed for first point (x1,y1)
|
Line2D(double x,
double y,
Vector2 directionVector)
Line computed by point and directional vector.
|
Modifier and Type | Method and Description |
---|---|
double |
getA() |
double |
getB() |
double |
getC() |
List<Vector2> |
getCircleIntersection(Circle c)
Returns intersection points for a given circle
(maximum list of 2 points, minimum empty list).
|
double |
getKx() |
double |
getKy() |
Vector2 |
getNormalVector() |
double |
getNx() |
double |
getNy() |
double |
getX1() |
double |
getX2() |
double |
getY1() |
double |
getY2() |
double |
solveGeneralEqation(double x,
double y)
Solve general equation of line for given point
|
String |
toString() |
private double x1
private double y1
private double x2
private double y2
private double a
private double b
private double c
private double nx
private double ny
private double kx
private double ky
public Line2D(double x1, double y1, double x2, double y2)
x1
- x axis of first pointy1
- y axis of first pointx2
- x axis of second pointy2
- y axis of second pointpublic Line2D(double x, double y, Vector2 directionVector)
x
- x axis of first pointy
- y axis of first pointdirectionVector
- x axis of first pointpublic Vector2 getNormalVector()
public double solveGeneralEqation(double x, double y)
x
- x axis of pointy
- y axis of pointpublic List<Vector2> getCircleIntersection(Circle c)
public double getX1()
public double getY1()
public double getX2()
public double getY2()
public double getA()
public double getB()
public double getC()
public double getNx()
public double getNy()
public double getKx()
public double getKy()