Constructor and Description |
---|
Line(double a,
double c)
creates a line y = ax + c
|
Line(double a,
double b,
double c)
creates a line ax + by + c = 0
|
Line(LineSegment seg)
creates a line through a given segment
|
Line(Point p,
Point q)
creates a line through 2 given points
|
Line(Point p,
Vector n)
creates a line through a given point and with a given normal vector
|
Modifier and Type | Method and Description |
---|---|
static boolean |
areParallel(Line l1,
Line l2) |
boolean |
contains(Point p) |
static Line |
getBisectorLine(Point p,
Point q)
Creates a bisector line between points p and q
|
Point |
getCenter()
Get the geometric center of the shape.
|
Vector |
getDirection() |
double |
getDistance(Point q)
returns the distance of the point q to the line
|
static Point |
getIntersection(Line l1,
Line l2) |
Point |
getPoint() |
Point |
getPoint(double d)
returns the point on the line at distance d from the line-defining point p
|
double |
getSlope() |
double |
intersectionParameter(Line l) |
boolean |
isAbove(Point q) |
boolean |
isBelow(Point q) |
boolean |
isParallelWith(Line l) |
boolean |
isVertical() |
double |
projectionParameter(Point q) |
Point |
projectPoint(Point q)
projects point p onto THIS line
|
void |
toConsole() |
void |
toConsole(java.lang.String name) |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String name) |
void |
translateTo(Point p)
translates the line so it goes through the point <p
|
public Line(Point p, Vector n)
public Line(LineSegment seg)
public Line(double a, double b, double c)
public Line(double a, double c)
public static Line getBisectorLine(Point p, Point q)
public Point getPoint()
public Vector getDirection()
public double getSlope()
public boolean isVertical()
public boolean isParallelWith(Line l)
public boolean isAbove(Point q)
public boolean isBelow(Point q)
public void translateTo(Point p)
p
- public Point projectPoint(Point q)
q
- point to be projectedpublic double projectionParameter(Point q)
public java.lang.String toString(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public void toConsole(java.lang.String name)
public void toConsole()
public Point getPoint(double d)
public double getDistance(Point q)
public double intersectionParameter(Line l)
public Point getCenter()
Shape