public class BarrierMath
extends java.lang.Object
Constructor and Description |
---|
BarrierMath() |
Modifier and Type | Method and Description |
---|---|
static double[] |
findLambdaAndT(Mover mover,
java.awt.geom.Point2D destination,
java.awt.geom.Line2D line)
Computes λ and t for a Mover considering movement to destination.
|
static double[] |
findLambdaAndT(Mover mover,
java.awt.geom.Point2D destination,
java.awt.geom.Point2D y0,
java.awt.geom.Point2D y1)
Finds λ and t for a Mover considering moving to destination and
possibly encountering a barrier between points y0 and y1
|
static double[] |
findLambdaAndT(java.awt.geom.Point2D xLocation,
java.awt.geom.Point2D xVelocity,
java.awt.geom.Point2D y0,
java.awt.geom.Point2D y1)
Compute λ and t for a Mover at xLocation traveling with
velocity xVelocity with respect to a line barrier [y0,y1].
|
static boolean |
isCollision(double[] lambdaAndT) |
public static double[] findLambdaAndT(java.awt.geom.Point2D xLocation, java.awt.geom.Point2D xVelocity, java.awt.geom.Point2D y0, java.awt.geom.Point2D y1)
Note that the trajectory intersects the barrier if 0 < λ < 1 and that the intersection will occur in the future if t > 0.
xLocation
- location of MoverxVelocity
- velocity of Movery0
- One endpoint of line barriery1
- Other endpoint of line barrierpublic static double[] findLambdaAndT(Mover mover, java.awt.geom.Point2D destination, java.awt.geom.Line2D line)
mover
- Given Moverdestination
- Given destinationline
- Line barrierpublic static double[] findLambdaAndT(Mover mover, java.awt.geom.Point2D destination, java.awt.geom.Point2D y0, java.awt.geom.Point2D y1)
mover
- Given Moverdestination
- Given destinationy0
- Given endpoint of line barriery1
- Given endpoint of line barrierpublic static boolean isCollision(double[] lambdaAndT)
lambdaAndT
- Given {λ, t}