|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphysics.GeometryImpl
public class GeometryImpl
GeometryImpl is the default implementation of GeometryInterface. Most callers will not use GeometryImpl directly, but will use the singleton Geometry instead.
GeometryImpl uses two parameters to tune its behavior.
maximumForesight indicates the maximal distance in
the future that the client is interested in learning about
collisions. Collisions past this time might still be reported,
but are not guaranteed to be found. In short, this parameter
causes the implementation to focus on finding collisions within
this time at the possible expense of not detecting collisions
past this time. This default value is +infinity.
searchSlices determines the number of slices used
to search for roots when using iterative numerical root finding
techniques. The default value is 15. Setting a higher value
will increase the chance of finding collision in the
timeUntilRotating* methods, but will cause them to run slower.
Geometry| Field Summary | |
|---|---|
protected double |
maximumForesight
|
protected int |
searchSlices
|
| Constructor Summary | |
|---|---|
GeometryImpl()
|
|
GeometryImpl(double maximumForesight,
int searchSlices)
|
|
| Method Summary | |
|---|---|
Vect |
applyReflectionCoeff(Vect incidentVect,
Vect reflectedVect,
double rCoeff)
Specified by Geometry.applyReflectionCoeff |
double |
distanceSquared(double x1,
double y1,
double x2,
double y2)
Specified by Geometry.distanceSquared |
double |
distanceSquared(Vect v1,
Vect v2)
Specified by Geometry.distanceSquared |
double |
minQuadraticSolution(double a,
double b,
double c)
Specified by Geometry.minQuadraticSolution |
Vect |
perpendicularPoint(LineSegment line,
Vect point)
Specified by Geometry.perpendicularPoint |
Vect |
perpendicularPointWholeLine(LineSegment line,
Vect point)
Specified by Geometry.perpendicularPointWholeLine |
Geometry.DoublePair |
quadraticSolution(double a,
double b,
double c)
Specified by Geometry.quadraticSolution |
Geometry.VectPair |
reflectBalls(Vect center1,
double mass1,
Vect velocity1,
Vect center2,
double mass2,
Vect velocity2)
Specified by Geometry.reflectBalls |
Vect |
reflectCircle(Vect circle,
Vect ball,
Vect velocity)
Specified by Geometry.reflectCircle |
Vect |
reflectCircle(Vect circle,
Vect ball,
Vect velocity,
double reflectionCoeff)
Specified by Geometry.reflectCircle |
Vect |
reflectRotatingCircle(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
Specified by Geometry.reflectRotatingCircle |
Vect |
reflectRotatingCircle(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity,
double reflectionCoeff)
Specified by Geometry.reflectRotatingCircle |
Vect |
reflectRotatingWall(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
Specified by Geometry.reflectRotatingWall |
Vect |
reflectRotatingWall(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity,
double reflectionCoeff)
Specified by Geometry.reflectRotatingWall |
Vect |
reflectWall(LineSegment line,
Vect velocity)
Specified by Geometry.reflectWall |
Vect |
reflectWall(LineSegment line,
Vect velocity,
double reflectionCoeff)
Specified by Geometry.reflectWall |
protected IntervalList |
restrictSearchInterval(IntervalList intervals,
double inner_radius,
double outer_radius,
double phi_1,
double phi_2,
double omega,
Vect center,
Circle ball,
Vect velocity)
Given the path of a ball and the path of something rotating in a circle, restricts the possible time periods during which they might collide by doing some crazy confusing analysis originally concocted by Professor Ernst. |
Circle |
rotateAround(Circle circle,
Vect cor,
Angle a)
Specified by Geometry.rotateAround |
LineSegment |
rotateAround(LineSegment line,
Vect cor,
Angle a)
Specified by Geometry.rotateAround |
Vect |
rotateAround(Vect point,
Vect cor,
Angle a)
Specified by Geometry.rotateAround |
double |
timeUntilBallBallCollision(Circle ball1,
Vect vel1,
Circle ball2,
Vect vel2)
Specified by Geometry.timeUntilBallBallCollision |
double |
timeUntilCircleCollision(Circle circle,
Circle ball,
Vect velocity)
Specified by Geometry.timeUntilCircleCollision |
Geometry.DoublePair |
timeUntilCircleCollision(Circle circle,
Vect point,
Vect velocity)
Specified by Geometry.timeUntilCircleCollision |
double |
timeUntilRotatingCircleCollision(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
Specified by Geometry.timeUntilRotatingCircleCollision |
double |
timeUntilRotatingWallCollision(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
Specified by Geometry.timeUntilRotatingWallCollision |
double |
timeUntilWallCollision(LineSegment line,
Circle ball,
Vect velocity)
Specified by Geometry.timeUntilWallCollision |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final double maximumForesight
protected final int searchSlices
| Constructor Detail |
|---|
public GeometryImpl()
public GeometryImpl(double maximumForesight,
int searchSlices)
| Method Detail |
|---|
public Geometry.DoublePair quadraticSolution(double a,
double b,
double c)
GeometryInterface
quadraticSolution in interface GeometryInterfaceGeometry.quadraticSolution(double, double, double)
public double minQuadraticSolution(double a,
double b,
double c)
GeometryInterface
minQuadraticSolution in interface GeometryInterfaceGeometry.minQuadraticSolution(double, double, double)
public Vect perpendicularPoint(LineSegment line,
Vect point)
GeometryInterface
perpendicularPoint in interface GeometryInterfaceGeometry.perpendicularPoint(physics.LineSegment, physics.Vect)
public Vect perpendicularPointWholeLine(LineSegment line,
Vect point)
GeometryInterface
perpendicularPointWholeLine in interface GeometryInterfaceGeometry.perpendicularPointWholeLine(physics.LineSegment, physics.Vect)
public Vect applyReflectionCoeff(Vect incidentVect,
Vect reflectedVect,
double rCoeff)
GeometryInterface
applyReflectionCoeff in interface GeometryInterfaceGeometry.applyReflectionCoeff(physics.Vect, physics.Vect, double)
public double timeUntilWallCollision(LineSegment line,
Circle ball,
Vect velocity)
GeometryInterface
timeUntilWallCollision in interface GeometryInterfaceGeometry.timeUntilWallCollision(physics.LineSegment, physics.Circle, physics.Vect)
public Vect reflectWall(LineSegment line,
Vect velocity,
double reflectionCoeff)
GeometryInterface
reflectWall in interface GeometryInterfaceGeometry.reflectWall(physics.LineSegment, physics.Vect, double)
public Vect reflectWall(LineSegment line,
Vect velocity)
GeometryInterface
reflectWall in interface GeometryInterfaceGeometry.reflectWall(physics.LineSegment, physics.Vect, double)
public double distanceSquared(Vect v1,
Vect v2)
GeometryInterface
distanceSquared in interface GeometryInterfaceGeometry.distanceSquared(physics.Vect, physics.Vect)
public double distanceSquared(double x1,
double y1,
double x2,
double y2)
GeometryInterface
distanceSquared in interface GeometryInterfaceGeometry.distanceSquared(physics.Vect, physics.Vect)
public double timeUntilCircleCollision(Circle circle,
Circle ball,
Vect velocity)
GeometryInterface
timeUntilCircleCollision in interface GeometryInterfaceGeometry.timeUntilCircleCollision(physics.Circle, physics.Circle, physics.Vect)
public Vect reflectCircle(Vect circle,
Vect ball,
Vect velocity,
double reflectionCoeff)
GeometryInterface
reflectCircle in interface GeometryInterfaceGeometry.reflectCircle(physics.Vect, physics.Vect, physics.Vect, double)
public Vect reflectCircle(Vect circle,
Vect ball,
Vect velocity)
GeometryInterface
reflectCircle in interface GeometryInterfaceGeometry.reflectCircle(physics.Vect, physics.Vect, physics.Vect, double)
public Vect rotateAround(Vect point,
Vect cor,
Angle a)
GeometryInterface
rotateAround in interface GeometryInterfaceGeometry.rotateAround(physics.Vect, physics.Vect, physics.Angle)
public LineSegment rotateAround(LineSegment line,
Vect cor,
Angle a)
GeometryInterface
rotateAround in interface GeometryInterfaceGeometry.rotateAround(physics.Vect, physics.Vect, physics.Angle)
public Circle rotateAround(Circle circle,
Vect cor,
Angle a)
GeometryInterface
rotateAround in interface GeometryInterfaceGeometry.rotateAround(physics.Vect, physics.Vect, physics.Angle)
public Geometry.DoublePair timeUntilCircleCollision(Circle circle,
Vect point,
Vect velocity)
GeometryInterface
timeUntilCircleCollision in interface GeometryInterfaceGeometry.timeUntilCircleCollision(physics.Circle, physics.Circle, physics.Vect)
protected IntervalList restrictSearchInterval(IntervalList intervals,
double inner_radius,
double outer_radius,
double phi_1,
double phi_2,
double omega,
Vect center,
Circle ball,
Vect velocity)
SimpleGeometry
public double timeUntilRotatingWallCollision(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
GeometryInterface
timeUntilRotatingWallCollision in interface GeometryInterfaceGeometry.timeUntilRotatingWallCollision(physics.LineSegment, physics.Vect, double, physics.Circle, physics.Vect)
public Vect reflectRotatingWall(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
GeometryInterface
reflectRotatingWall in interface GeometryInterfaceGeometry.reflectRotatingWall(physics.LineSegment, physics.Vect, double, physics.Circle, physics.Vect)
public Vect reflectRotatingWall(LineSegment line,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity,
double reflectionCoeff)
GeometryInterface
reflectRotatingWall in interface GeometryInterfaceGeometry.reflectRotatingWall(physics.LineSegment, physics.Vect, double, physics.Circle, physics.Vect)
public double timeUntilRotatingCircleCollision(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
GeometryInterface
timeUntilRotatingCircleCollision in interface GeometryInterfaceGeometry.timeUntilRotatingCircleCollision(physics.Circle, physics.Vect, double, physics.Circle, physics.Vect)
public Vect reflectRotatingCircle(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity)
GeometryInterface
reflectRotatingCircle in interface GeometryInterfaceGeometry.reflectRotatingCircle(physics.Circle, physics.Vect, double, physics.Circle, physics.Vect)
public Vect reflectRotatingCircle(Circle circle,
Vect center,
double angularVelocity,
Circle ball,
Vect velocity,
double reflectionCoeff)
GeometryInterface
reflectRotatingCircle in interface GeometryInterfaceGeometry.reflectRotatingCircle(physics.Circle, physics.Vect, double, physics.Circle, physics.Vect)
public double timeUntilBallBallCollision(Circle ball1,
Vect vel1,
Circle ball2,
Vect vel2)
GeometryInterface
timeUntilBallBallCollision in interface GeometryInterfaceGeometry.timeUntilBallBallCollision(physics.Circle, physics.Vect, physics.Circle, physics.Vect)
public Geometry.VectPair reflectBalls(Vect center1,
double mass1,
Vect velocity1,
Vect center2,
double mass2,
Vect velocity2)
GeometryInterface
reflectBalls in interface GeometryInterfaceGeometry.reflectBalls(physics.Vect, double, physics.Vect, physics.Vect, double, physics.Vect)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||