#include <Geometry.h>
Public Methods | |
Line (double a, double b, double c) | |
void | show (ostream &os=cout) |
VecPosition | getIntersection (Line line) |
int | getCircleIntersectionPoints (Circle circle, VecPosition *posSolution1, VecPosition *posSolution2) |
Line | getTangentLine (VecPosition pos) |
VecPosition | getPointOnLineClosestTo (VecPosition pos) |
double | getDistanceWithPoint (VecPosition pos) |
bool | isInBetween (VecPosition pos, VecPosition point1, VecPosition point2) |
double | getYGivenX (double x) |
double | getXGivenY (double y) |
double | getACoefficient () const |
double | getBCoefficient () const |
double | getCCoefficient () const |
Static Public Methods | |
Line | makeLineFromTwoPoints (VecPosition pos1, VecPosition pos2) |
Line | makeLineFromPositionAndAngle (VecPosition vec, AngDeg angle) |
Private Attributes | |
double | m_a |
double | m_b |
double | m_c |
Friends | |
ostream & | operator<< (ostream &os, Line l) |
Definition at line 267 of file Geometry.h.
|
This constructor creates a line by given the three coefficents of the line. A line is specified by the formula ay + bx + c = 0.
Definition at line 1364 of file Geometry.cpp. Referenced by getTangentLine(), and makeLineFromTwoPoints(). |
|
This method returns the a coefficient from the line ay + bx + c = 0.
Definition at line 1614 of file Geometry.cpp. References m_a. Referenced by getIntersection(), and operator<<(). |
|
This method returns the b coefficient from the line ay + bx + c = 0.
Definition at line 1621 of file Geometry.cpp. References m_b. Referenced by getIntersection(), and operator<<(). |
|
This method returns the c coefficient from the line ay + bx + c = 0.
Definition at line 1628 of file Geometry.cpp. References m_c. Referenced by getIntersection(), and operator<<(). |
|
This method calculates the intersection points between the current line and the circle specified with as center 'posCenter' and radius 'dRadius'. The number of solutions are returned and the corresponding points are put in the third and fourth argument of the method
Definition at line 1448 of file Geometry.cpp. References Geometry::abcFormula(), EPSILON, Circle::getCenter(), Circle::getRadius(), VecPosition::getX(), VecPosition::getY(), m_a, m_b, m_c, and VecPosition::setVecPosition(). Referenced by BasicPlayer::interceptClose(). |
|
This method returns the distance between a specified position and the closest point on the given line.
Definition at line 1519 of file Geometry.cpp. References VecPosition::getDistanceTo(), and getPointOnLineClosestTo(). Referenced by WorldModel::predictCommandTurnTowards(). |
|
This method returns the intersection point between the current Line and the specified line.
Definition at line 1409 of file Geometry.cpp. References getACoefficient(), getBCoefficient(), getCCoefficient(), getYGivenX(), m_a, m_b, and m_c. Referenced by BasicPlayer::clearBall(), BasicPlayer::defendGoalLine(), Player::deMeer5_goalie(), WorldModel::getOuterPositionInField(), getPointOnLineClosestTo(), BasicPlayer::getShootPositionOnLine(), BasicPlayer::interceptScoringAttempt(), WorldModel::isBallHeadingToGoal(), BasicPlayer::kickBallCloseToBody(), and BasicPlayer::moveToPosAlongLine(). |
|
This method returns the closest point on a line to a given position.
Definition at line 1509 of file Geometry.cpp. References getIntersection(), and getTangentLine(). Referenced by WorldModel::getClosestInSetTo(), getDistanceWithPoint(), WorldModel::getMarkingPosition(), WorldModel::getNrInSetInCone(), BasicPlayer::interceptCloseGoalie(), isInBetween(), BasicPlayer::kickTo(), BasicPlayer::moveToPosAlongLine(), and BasicPlayer::outplayOpponent(). |
|
This method returns the tangent line to a VecPosition. This is the line between the specified position and the closest point on the line to this position.
Definition at line 1498 of file Geometry.cpp. References VecPosition::getX(), VecPosition::getY(), Line(), m_a, and m_b. Referenced by getPointOnLineClosestTo(). |
|
This method calculates the x coordinate given the x coordinate
Definition at line 1562 of file Geometry.cpp. |
|
This method calculates the y coordinate given the x coordinate
Definition at line 1546 of file Geometry.cpp. References m_a, m_b, m_c, and show(). Referenced by getIntersection(), and WorldModel::getMarkingPosition(). |
|
This method determines whether the projection of a point on the current line lies between two other points ('point1' and 'point2') that lie on the same line.
Definition at line 1532 of file Geometry.cpp. References VecPosition::getDistanceTo(), and getPointOnLineClosestTo(). Referenced by WorldModel::getClosestInSetTo(), WorldModel::getMarkingPosition(), and WorldModel::getNrInSetInCone(). |
|
This method creates a line given a position and an angle.
Definition at line 1605 of file Geometry.cpp. References AngDeg, makeLineFromTwoPoints(), and POLAR. Referenced by BasicPlayer::clearBall(), BasicPlayer::defendGoalLine(), WorldModel::getOuterPositionInField(), BasicPlayer::getShootPositionOnLine(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), BasicPlayer::interceptScoringAttempt(), WorldModel::isBallHeadingToGoal(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::moveToPosAlongLine(), BasicPlayer::outplayOpponent(), and WorldModel::predictCommandTurnTowards(). |
|
This method creates a line given two points.
Definition at line 1577 of file Geometry.cpp. References EPSILON, VecPosition::getX(), VecPosition::getY(), and Line(). Referenced by BasicPlayer::clearBall(), BasicPlayer::defendGoalLine(), Player::deMeer5_goalie(), WorldModel::getMarkingPosition(), WorldModel::getNrInSetInCone(), BasicPlayer::getShootPositionOnLine(), WorldModel::isBallHeadingToGoal(), BasicPlayer::kickTo(), makeLineFromPositionAndAngle(), and BasicPlayer::moveToPosAlongLine(). |
|
This method prints the line information to the specified output stream.
Definition at line 1400 of file Geometry.cpp. Referenced by getYGivenX(). |
|
This function prints the line to the specified output stream in the format y = ax + b.
Definition at line 1376 of file Geometry.cpp. |
|
This is the a coefficient in the line ay + bx + c = 0 Definition at line 270 of file Geometry.h. Referenced by getACoefficient(), getCircleIntersectionPoints(), getIntersection(), getTangentLine(), getXGivenY(), getYGivenX(), and Line(). |
|
This is the b coefficient in the line ay + bx + c = 0 Definition at line 271 of file Geometry.h. Referenced by getBCoefficient(), getCircleIntersectionPoints(), getIntersection(), getTangentLine(), getXGivenY(), getYGivenX(), and Line(). |
|
This is the c coefficient in the line ay + bx + c = 0 Definition at line 272 of file Geometry.h. Referenced by getCCoefficient(), getCircleIntersectionPoints(), getIntersection(), getXGivenY(), getYGivenX(), and Line(). |