public final class Line extends Object
line
datatype in Postgres.
Lines are represented by the linear equation Ax + By + C = 0.
Uses double
to represent the coordinates.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
double |
getA() |
double |
getB() |
double |
getC() |
int |
hashCode() |
static Line |
of(double a,
double b,
double c)
|
static Line |
of(double x1,
double y1,
double x2,
double y2)
Create a new
Line defined by two points. |
static Line |
of(Point p1,
Point p2)
Create a new
Line defined by two points. |
String |
toString() |
public static Line of(double a, double b, double c)
a
- coefficient of xb
- coefficient of yc
- constantLine
objectpublic static Line of(Point p1, Point p2)
Line
defined by two points.p1
- first point on the linep2
- second point on the lineLine
objectIllegalArgumentException
- if p1
or p2
is null
public static Line of(double x1, double y1, double x2, double y2)
Line
defined by two points.x1
- the x-coordinate of the first point on the liney1
- the y-coordinate of the first point on the linex2
- the x-coordinate of the second point on the liney2
- the y-coordinate of the second point on the lineLine
objectpublic double getA()
public double getB()
public double getC()
Copyright © 2020. All rights reserved.