java.lang.Object | |
↳ | com.commsignia.v2x.utils.vectors.VectorUtils |
Useful utilities for handling vectors
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Vector2D |
headingVector(double degrees)
Calculate heading vector based on degrees
| ||||||||||
static Point2D |
intersectionPoint(Point2D ps1, Point2D pe1, Point2D ps2, Point2D pe2)
Calculate the intersection point of two lines.
| ||||||||||
static Point2D |
intersectionPoint(Point2D firstVehicle, double firstVehicleHeading, Point2D secondVehicle, double secondVehicleHeading)
Determine if two vehicles might have an intersection point based on their point in space and their heading
| ||||||||||
static Point2D |
intersectionPoint(Point2D firstVehicle, Vector2D firstVehicleDirection, Point2D secondVehicle, Vector2D secondVehicleDirection)
Determine the intersection point of two vehicles based on their point in space and heading vector
| ||||||||||
static boolean |
isInsideHalfPlane(Point2D p0, Vector2D dir, Point2D p)
Determines if p point is inside the half plane denoted by point p0 and direction.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Calculate heading vector based on degrees
degrees | heading degree |
---|
Calculate the intersection point of two lines.
ps1 | The start coordinate of the first line |
---|---|
pe1 | The end coordinate of the first line |
ps2 | The start coordinate of the second line |
pe2 | The end coordinate of the second line |
Determine if two vehicles might have an intersection point based on their point in space and their heading
firstVehicle | location of the first vehicle |
---|---|
firstVehicleHeading | heading of the first vehicle |
secondVehicle | location of the second vehicle |
secondVehicleHeading | heading of the second vehicle |
Determine the intersection point of two vehicles based on their point in space and heading vector
firstVehicle | location of the first vehicle |
---|---|
firstVehicleDirection | direction of the first vehicle as a heading vector see headingVector(double) |
secondVehicle | location of the second vehicle |
secondVehicleDirection | direction of the second vehicle as a heading vector see headingVector(double) |
Determines if p point is inside the half plane denoted by point p0 and direction.
p0 | point |
---|---|
dir | direction |
p | other point |