#include "math.h"
#include <string>
#include <iostream>
Include dependency graph for Geometry.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Compounds | |
class | Circle |
class | Geometry |
class | Line |
class | Rect |
class | VecPosition |
Defines | |
#define | EPSILON 0.0001 |
Typedefs | |
typedef double | AngRad |
typedef double | AngDeg |
Enumerations | |
enum | CoordSystemT { CARTESIAN, POLAR } |
Functions | |
double | max (double d1, double d2) |
double | min (double d1, double d2) |
int | sign (double d1) |
AngDeg | Rad2Deg (AngRad x) |
AngRad | Deg2Rad (AngDeg x) |
double | cosDeg (AngDeg x) |
double | sinDeg (AngDeg x) |
double | tanDeg (AngDeg x) |
AngDeg | atanDeg (double x) |
double | atan2Deg (double x, double y) |
AngDeg | acosDeg (double x) |
AngDeg | asinDeg (double x) |
bool | isAngInInterval (AngDeg ang, AngDeg angMin, AngDeg angMax) |
AngDeg | getBisectorTwoAngles (AngDeg angMin, AngDeg angMax) |
File: Geometry.h Project: Robocup Soccer Simulation Team: UvA Trilearn Authors: Jelle Kok Created: 12/02/2001 Last Revision: $ID$ Contents: Header file for the classes VecPosition, Geometry, Line, Circle and Rectangle. All the member data and member method declarations for all these classes can be found in this file together with some auxiliary functions for numeric and goniometric purposes.
Changes
Date Author Comment 12/02/2001 Jelle Kok Initial version created 09/06/2001 Remco de Boer Version including full documentation completed
Definition in file Geometry.h.
|
Value used for floating point equality tests. Definition at line 63 of file Geometry.h. Referenced by Geometry::abcFormula(), atan2Deg(), Line::getCircleIntersectionPoints(), WorldModel::getFastestInSetTo(), Line::makeLineFromTwoPoints(), WorldModel::predictNrCyclesForDistance(), WorldModel::predictNrCyclesToObject(), DynamicObject::setGlobalVelocity(), VecPosition::setMagnitude(), WorldModel::updateAgentAndBallAfterSense(), and WorldModel::updateParticlesBall(). |
|
|
Type definition for angles in degrees. Definition at line 60 of file Geometry.h. |
|
CoordSystem is an enumeration of the different specified coordinate systems. The two possibilities are CARTESIAN or POLAR. These values are for instance used in the initializing a VecPosition. The CoordSystem indicates whether the supplied arguments represent the position in cartesian or in polar coordinates. Definition at line 93 of file Geometry.h. Referenced by acosDeg(), atan2Deg(), VecPosition::setVecPosition(), VecPosition::show(), sinDeg(), VecPosition::str(), and VecPosition::VecPosition(). |
|
This function returns the principal value of the arc cosine of x in degrees using the built-in arc cosine function which returns this value in radians.
Definition at line 161 of file Geometry.cpp. References AngDeg, CARTESIAN, and CoordSystemT. |
|
This function returns the principal value of the arc sine of x in degrees using the built-in arc sine function which returns this value in radians.
Definition at line 175 of file Geometry.cpp. References AngDeg. Referenced by BasicPlayer::accelerateBallToVelocity(), and BasicPlayer::kickTo(). |
|
This function returns the principal value of the arc tangent of y/x in degrees using the signs of both arguments to determine the quadrant of the return value. For this the built-in 'atan2' function is used which returns this value in radians.
Definition at line 149 of file Geometry.cpp. References CARTESIAN, and CoordSystemT. Referenced by WorldModel::calculateAngleAgentWithPos(), getBisectorTwoAngles(), and VecPosition::getDirection(). |
|
This function returns the principal value of the arc tangent of x in degrees using the built-in arc tangent function which returns this value in radians.
Definition at line 136 of file Geometry.cpp. |
|
This function returns the cosine of a given angle in degrees using the built-in cosine function that works with angles in radians.
Definition at line 108 of file Geometry.cpp. Referenced by WorldModel::calculateAngleAgentWithPos(), WorldModel::calculateVelocityDynamicObject(), getBisectorTwoAngles(), VecPosition::getVecPositionFromPolar(), and WorldModel::initParticlesBall(). |
|
This function converts an angle in degrees to the corresponding angle in radians.
Definition at line 99 of file Geometry.cpp. Referenced by WorldModel::calculateVelocityDynamicObject(), cosDeg(), WorldModel::initParticlesBall(), sinDeg(), and tanDeg(). |
|
This method returns the bisector (average) of two angles. It deals with the boundary problem, thus when 'angMin' equals 170 and 'angMax' equals -100, -145 is returned.
Definition at line 212 of file Geometry.cpp. Referenced by WorldModel::getDirectionOfWidestAngle(), and WorldModel::getMarkingPosition(). |
|
This function returns a boolean value which indicates whether the value 'ang' (from interval [-180..180] lies in the interval [angMin..angMax]. Examples: isAngInInterval( -100, 4, -150) returns false isAngInInterval( 45, 4, -150) returns true
Definition at line 193 of file Geometry.cpp. References AngDeg. Referenced by BasicPlayer::mark(), and BasicPlayer::searchBall(). |
|
This function returns the maximum of two given doubles.
Definition at line 71 of file Geometry.cpp. References AngDeg, and AngRad. Referenced by BasicPlayer::clearBall(), Object::getConfidence(), WorldModel::getDirectionOfWidestAngle(), WorldModel::getFastestInSetTo(), WorldModel::getMinMaxDistChange(), WorldModel::getOffsideX(), WorldModel::getProbTackleSucceeds(), BasicPlayer::getShootPositionOnLine(), WorldModel::getStrategicPosition(), WorldModel::getTackleExpires(), WorldModel::invQuantizeMin(), Player::makeBallInfo(), WorldModel::predictCommandToInterceptBall(), WorldModel::predictNrCyclesForDistance(), WorldModel::predictNrCyclesToObject(), WorldModel::predictNrCyclesToPoint(), Player::sayOppAttackerStatus(), SenseHandler::SenseHandler(), and Rect::setRectanglePoints(). |
|
This function returns the minimum of two given doubles.
Definition at line 80 of file Geometry.cpp. References AngDeg. Referenced by WorldModel::createInterceptFeatures(), BasicPlayer::freezeBall(), WorldModel::getDirectionOfWidestAngle(), Circle::getIntersectionArea(), WorldModel::getMarkingPosition(), WorldModel::getMinMaxDistChange(), WorldModel::getProbTackleSucceeds(), BasicPlayer::getShootPositionOnLine(), WorldModel::getStrategicPosition(), Player::makeBallInfo(), BasicPlayer::outplayOpponent(), WorldModel::predictCommandToInterceptBall(), WorldModel::predictCommandTurnTowards(), SenseHandler::SenseHandler(), and Rect::setRectanglePoints(). |
|
This function converts an angle in radians to the corresponding angle in degrees.
Definition at line 90 of file Geometry.cpp. Referenced by acosDeg(), asinDeg(), atan2Deg(), atanDeg(), and WorldModel::checkParticlesBall(). |
|
This function returns the sign of a give double. 1 is positive, -1 is negative
Definition at line 62 of file Geometry.cpp. Referenced by WorldModel::calculateStateBall(), BasicPlayer::defendGoalLine(), BasicPlayer::dribble(), Player::getDeadBallPosition(), WorldModel::getMarkingPosition(), Formations::getStrategicPosition(), BasicPlayer::holdBall(), BasicPlayer::interceptScoringAttempt(), BasicPlayer::kickBallCloseToBody(), and WorldModel::updateAgentAndBallAfterSense(). |
|
This function returns the sine of a given angle in degrees using the built-in sine function that works with angles in radians.
Definition at line 117 of file Geometry.cpp. References CARTESIAN, and CoordSystemT. Referenced by WorldModel::calculateAngleAgentWithPos(), WorldModel::calculateVelocityDynamicObject(), getBisectorTwoAngles(), VecPosition::getVecPositionFromPolar(), and WorldModel::initParticlesBall(). |
|
This function returns the tangent of a given angle in degrees using the built-in tangent function that works with angles in radians.
Definition at line 126 of file Geometry.cpp. |