public class Vector extends Object
Constructor and Description |
---|
Vector() |
Modifier and Type | Method and Description |
---|---|
static Point |
add(Point p0,
Point p1)
Adds two
Point s. |
static double |
dot(Point p0,
Point p1)
Returns the dot-product of the specified
Point s |
static double |
dot(Point p0,
Point p1,
boolean limit2D)
Returns the dot-product of the specified
Point s |
static Point |
perp(Point p)
Hill's "perp" operator.
|
static double |
perpDot(Point p0,
Point p1)
Applies the perp dot-operation on the specified
Point s |
static double[] |
pointToSegment2D(Point p0,
Point p1,
Point y)
Returns the squared distance and projectionfactor of the point y
on the linesegment defined by points p0 and p1
|
static Point |
substract(Point p0,
Point p1)
Subtracts two
Point s. |
public static double[] pointToSegment2D(Point p0, Point p1, Point y)
The projection factor is the value for t that determines the projection of y on the line p0 + t*(p1-p0).
p0
- the start point of the line segmentp1
- the end point of the line segmenty
- the point to project onto the linesegmentpublic static double dot(Point p0, Point p1)
Point
sp0
- first operandp1
- second operandpublic static double dot(Point p0, Point p1, boolean limit2D)
Point
s
If limit2D is set to true, Z-coordinates will be ignored so that the product is calculated in 2D.
If any of the parameters are 2D, the operation is performed in 2D.
p0
- first operandp1
- second operandlimit2D
- if true, the dot-product will be in 2D.public static Point add(Point p0, Point p1)
Point
s.
If any of the parameters are 2D, the operation is performed in 2D.
p0
- first operandp1
- second operandpublic static Point substract(Point p0, Point p1)
Point
s.
If any of the parameters are 2D, the operation is performed in 2D.
p0
- first operandp1
- second operandpublic static Point perp(Point p)
The application of this operator on a vector P
returns the vector perpendicular at 90 deg. counterclockwise
from P
in the 2D (X/Y) plane.
p
- a vector represented by a point.public static double perpDot(Point p0, Point p1)
Point
s
The perp dot operation on vectors P
, Q
is defined as
dot(perp(P),Q)
.
This operation will be performed in 2D only.
p0
- first operandp1
- second operandCopyright © 2015 geolatte.org. All rights reserved.