Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Geometry.h File Reference

#include "math.h"
#include <string>

Include dependency graph for Geometry.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class  Circle
class  Geometry
class  Line
class  Rectangle
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)


Detailed Description

File:          Geometry.h
Project:       Robocup Soccer Simulation Team: UvA Trilearn 2001
Authors:       Jelle Kok and Remco de Boer
Created:       12/02/2001
Last Revision: 06/01/2002
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.

Definition in file Geometry.h.


Define Documentation

#define EPSILON   0.0001
 

Value used for floating point equality tests.

Definition at line 54 of file Geometry.h.

Referenced by Geometry::abcFormula(), atan2Deg(), Line::getCircleIntersectionPoints(), Line::makeLineFromTwoPoints(), DynamicObject::setGlobalVelocity(), VecPosition::setMagnitude(), and WorldModel::updateParticlesBall().


Typedef Documentation

typedef double AngDeg
 

Type definition for angles in radians.

Definition at line 52 of file Geometry.h.

Referenced by BasicPlayer::accelerateBallToVelocity(), acosDeg(), SenseHandler::analyzeSeeGlobalMessage(), SenseHandler::analyzeSeeMessage(), SenseHandler::analyzeSenseMessage(), asinDeg(), atanDeg(), WorldModel::calculateAngleAgentWithPos(), WorldModel::calculatePosAgentWith2Flags(), WorldModel::calculateStateAgent(), WorldModel::calculateStateAgent2(), WorldModel::checkParticlesAgent(), WorldModel::checkParticlesBall(), BasicPlayer::clearBall(), cosDeg(), BasicPlayer::defendGoalLine(), Deg2Rad(), Player::deMeer5_goalie(), BasicPlayer::dribble(), WorldModel::getActualTurnAngle(), WorldModel::getAgentBodyAngleRelToNeck(), WorldModel::getAgentGlobalBodyAngle(), WorldModel::getAgentGlobalNeckAngle(), WorldModel::getAngleForTurn(), WorldModel::getBallDirection(), getBisectorTwoAngles(), AgentObject::getBodyAngleRelToNeck(), VecPosition::getDirection(), WorldModel::getDirectionOfWidestAngle(), WorldModel::getGlobalAngle(), FixedObject::getGlobalAngle(), SoccerTypes::getGlobalAngleLine(), WorldModel::getGlobalBodyAngle(), PlayerObject::getGlobalBodyAngle(), WorldModel::getGlobalNeckAngle(), SoccerTypes::getHalfViewAngleValue(), BasicPlayer::getInterceptionPointBall(), Circle::getIntersectionArea(), BasicPlayer::getMarkingPosition(), WorldModel::getOuterPositionInField(), WorldModel::getPowerForDash(), WorldModel::getRelativeAngle(), Object::getRelativeAngle(), PlayerObject::getRelativeBodyAngle(), PlayerObject::getRelativeNeckAngle(), BasicPlayer::getShootPositionOnLine(), VecPosition::getVecPositionFromPolar(), VecPosition::globalToRelative(), WorldModel::initParticlesAgent(), WorldModel::initParticlesBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), isAngInInterval(), WorldModel::isOpponentAtAngle(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), Line::makeLineFromPositionAndAngle(), max(), min(), BasicPlayer::moveToPos(), BasicPlayer::moveToPosAlongLine(), VecPosition::normalizeAngle(), BasicPlayer::outplayOpponent(), PlayerObject::PlayerObject(), WorldModel::predictAgentPosAfterCommand(), WorldModel::predictAgentStateAfterCommand(), WorldModel::predictNrCyclesToPoint(), WorldModel::predictStateAfterCommand(), WorldModel::predictStateAfterTurn(), WorldModel::processNewAgentInfo(), WorldModel::processNewObjectInfo(), WorldModel::processSeeGlobalInfo(), Rad2Deg(), VecPosition::relativeToGlobal(), WorldModel::removeGhosts(), VecPosition::rotate(), BasicPlayer::searchBall(), PlayerObject::setGlobalBodyAngle(), AgentObject::setGlobalNeckAngle(), PlayerObject::setGlobalNeckAngle(), PlayerObject::setRelativeBodyAngle(), PlayerObject::setRelativeNeckAngle(), Object::setRelativePosition(), AgentObject::setSpeedRelToNeck(), sign(), sinDeg(), tanDeg(), BasicPlayer::throughPass(), BasicPlayer::turnBackToPoint(), BasicPlayer::turnBodyToPoint(), BasicPlayer::turnNeckToPoint(), BasicPlayer::turnWithBallTo(), WorldModel::updateAgentAndBallAfterSense(), WorldModel::updateAgentObjectAfterSee(), WorldModel::updateBallAfterKick(), WorldModel::updateDynamicObjectAfterSee(), and WorldModel::updateParticlesBall().

typedef double AngRad
 

Type definition for angles in degrees.

Definition at line 51 of file Geometry.h.

Referenced by Deg2Rad(), Rad2Deg(), and sign().


Enumeration Type Documentation

enum CoordSystemT
 

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 83 of file Geometry.h.

Referenced by atan2Deg(), atanDeg(), VecPosition::setVecPosition(), VecPosition::show(), VecPosition::str(), and VecPosition::VecPosition().


Function Documentation

AngDeg acosDeg double    x
 

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.

Parameters:
x  a double value
Returns:
the arc cosine of the given value in degrees

Definition at line 155 of file Geometry.C.

References AngDeg.

AngDeg asinDeg double    x
 

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.

Parameters:
x  a double value
Returns:
the arc sine of the given value in degrees

Definition at line 169 of file Geometry.C.

References AngDeg.

Referenced by BasicPlayer::accelerateBallToVelocity(), and BasicPlayer::kickTo().

double atan2Deg double    x,
double    y
 

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.

Parameters:
x  a double value
y  a double value
Returns:
the arc tangent of y/x in degrees taking the signs of x and y into account

Definition at line 143 of file Geometry.C.

References CoordSystemT.

Referenced by WorldModel::calculateAngleAgentWithPos(), getBisectorTwoAngles(), and VecPosition::getDirection().

AngDeg atanDeg double    x
 

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.

Parameters:
x  a double value
Returns:
the arc tangent of the given value in degrees

Definition at line 130 of file Geometry.C.

References CoordSystemT.

double cosDeg AngDeg    x
 

This function returns the cosine of a given angle in degrees using the built-in cosine function that works with angles in radians.

Parameters:
x  an angle in degrees
Returns:
the cosine of the given angle

Definition at line 103 of file Geometry.C.

References VecPosition::m_x.

Referenced by WorldModel::calculateAngleAgentWithPos(), WorldModel::calculateVelocityDynamicObject(), getBisectorTwoAngles(), VecPosition::getVecPositionFromPolar(), and WorldModel::initParticlesBall().

AngRad Deg2Rad AngDeg    x
 

This function converts an angle in degrees to the corresponding angle in radians.

Parameters:
x  an angle in degrees
Returns:
the corresponding angle in radians

Definition at line 94 of file Geometry.C.

Referenced by WorldModel::calculateVelocityDynamicObject(), cosDeg(), WorldModel::initParticlesBall(), sinDeg(), and tanDeg().

AngDeg getBisectorTwoAngles AngDeg    angMin,
AngDeg    angMax
 

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.

Parameters:
angMin  minimum angle [-180,180]
angMax  maximum angle [-180,180]
Returns:
average of angMin and angMax.

Definition at line 206 of file Geometry.C.

Referenced by WorldModel::getDirectionOfWidestAngle(), and BasicPlayer::getMarkingPosition().

bool isAngInInterval AngDeg    ang,
AngDeg    angMin,
AngDeg    angMax
 

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

Parameters:
ang  angle that should be checked
angMin  minimum angle in interval
angMax  maximum angle in interval
Returns:
boolean indicating whether ang lies in [angMin..angMax]

Definition at line 187 of file Geometry.C.

References AngDeg.

Referenced by BasicPlayer::searchBall().

double max double    d1,
double    d2
 

This function returns the maximum of two given doubles.

Parameters:
d1  first parameter
d2  second parameter
Returns:
the maximum of these two parameters

Definition at line 66 of file Geometry.C.

References AngDeg.

Referenced by Object::getConfidence(), WorldModel::getMinMaxDistChange(), WorldModel::getOffsideX(), BasicPlayer::getShootPositionOnLine(), and Rectangle::setRectanglePoints().

double min double    d1,
double    d2
 

This function returns the minimum of two given doubles.

Parameters:
d1  first parameter
d2  second parameter
Returns:
the minimum of these two parameters

Definition at line 75 of file Geometry.C.

References AngDeg.

Referenced by Circle::getIntersectionArea(), WorldModel::getMinMaxDistChange(), BasicPlayer::getShootPositionOnLine(), Player::getStrategicPosition(), BasicPlayer::outplayOpponent(), and Rectangle::setRectanglePoints().

AngDeg Rad2Deg AngRad    x
 

This function converts an angle in radians to the corresponding angle in degrees.

Parameters:
x  an angle in radians
Returns:
the corresponding angle in degrees

Definition at line 85 of file Geometry.C.

Referenced by acosDeg(), asinDeg(), atan2Deg(), atanDeg(), and WorldModel::checkParticlesBall().

int sign double    d1
 

This function returns the sign of a give double. 1 is positive, -1 is negative

Parameters:
d1  first parameter
Returns:
the sign of this double

Definition at line 57 of file Geometry.C.

References AngDeg, and AngRad.

Referenced by BasicPlayer::defendGoalLine().

double sinDeg AngDeg    x
 

This function returns the sine of a given angle in degrees using the built-in sine function that works with angles in radians.

Parameters:
x  an angle in degrees
Returns:
the sine of the given angle

Definition at line 112 of file Geometry.C.

Referenced by WorldModel::calculateAngleAgentWithPos(), WorldModel::calculateVelocityDynamicObject(), getBisectorTwoAngles(), VecPosition::getVecPositionFromPolar(), and WorldModel::initParticlesBall().

double tanDeg AngDeg    x
 

This function returns the tangent of a given angle in degrees using the built-in tangent function that works with angles in radians.

Parameters:
x  an angle in degrees
Returns:
the tangent of the given angle

Definition at line 121 of file Geometry.C.


Generated on Thu Mar 7 00:37:47 2002 for UvA Trilearn 2001 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001