Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# PfVec Class Reference

A simple vector with two double components. More...

`#include <PfieldDatatypes.h>`

List of all members.

## Public Member Functions
| PfVec ()
| Constructor.
| PfVec (double x, double y)
| Constructor.
| PfVec (const PfVec &p)
| Copy-Constructor.
double | distanceTo (const PfVec &v) const
| Distance to another vector.
void | rotate (double angle)
| Rotates around an angle.
void | normalize ()
| Normalizes the vector to length==1.
double | length () const
| Returns the length of the vector.
double | squareLength () const
| Returns the squared length of the vector.
void | operator= (const PfVec &v)
| Assigns another vector.
PfVec | operator+ (const PfVec &v) const
| Adds another vector.
PfVec | operator- (const PfVec &v) const
| Substracts another vector.
void | operator *= (const double &n)
| Scales the vector.
PfVec | operator * (const double &n) const
| Returns a scaled vector.
void | operator+= (const PfVec &p)
| Adds another vector.
void | operator-= (const PfVec &p)
| Substracts another vector.
double | scalarProduct (const PfVec &p) const
| Multiplies with another vector.
double | getAngle () const
| Computes the angle of the vector.
## Public Attributes
double | x
| The x-component.
double | y
| The y-component.

## Detailed Description

A simple vector with two double components.

Definition at line 25 of file PfieldDatatypes.h.

## Constructor & Destructor Documentation

PfVec::PfVec | ( |  | ) | `[inline]`

| Constructor. Definition at line 34 of file PfieldDatatypes.h.

PfVec::PfVec | ( | double | x,
|  | double | y
| ) | `[inline]`

  | Constructor. Parameters:
  x | The x component
  y | The y component
Definition at line 44 of file PfieldDatatypes.h.

PfVec::PfVec | ( | const PfVec & | p | ) | `[inline]`

  | Copy-Constructor. Parameters:
  p | Another vector
Definition at line 53 of file PfieldDatatypes.h.

## Member Function Documentation

double PfVec::distanceTo | ( | const PfVec & | v | ) | const`[inline]`

  | Distance to another vector. Parameters:
  v | The other vector
Returns: The distance Definition at line 62 of file PfieldDatatypes.h. References x, and y. Referenced by computeChargeForPointfield(), computeChargeForSectorfield(), PotentialfieldAStarNode::computeCurrentParameters(), computeGradientForSectorfield(), NoGeometry::distanceTo(), Polygon::distanceTo(), Line::distanceTo(), Circle::distanceTo(), FutureWorldModelGenerator::executeSingleTransformation(), pointPerpendicularToLine(), and RelativeFormation::updateGeometry().

void PfVec::rotate | ( | double | angle | ) | `[inline]`

  | Rotates around an angle. Parameters:
  angle | The angle
Definition at line 72 of file PfieldDatatypes.h. Referenced by PfPose::addVector(), PotentialFieldsObject::computeAbsFieldVecAt(), computeGradientForSectorfield(), PotentialfieldAStarNode::computeHeuristicBetween(), Polygon::distanceTo(), Line::distanceTo(), Motionfield::execute(), FutureWorldModelGenerator::executeSingleTransformation(), PotentialfieldAStarNode::expand(), Line::getAbs(), PfPose::getAngleTo(), RandomMotionGenerator::getMotionVector(), PfPose::getRelativeVectorTo(), Action::poseInsideImpactArea(), PfPose::rotateAround(), Line::setAbsoluteFromOther(), GTStandardConverter::setData(), and RelativeFormation::updateGeometry().

void PfVec::normalize | ( |  | ) | `[inline]`

| Normalizes the vector to length==1. Definition at line 82 of file PfieldDatatypes.h. References length(). Referenced by computeGradientForPointfield(), computeGradientForSectorfield(), computeGradientForShapefield(), Motionfield::correctMotionVector(), Circle::distanceTo(), PotentialfieldComposition::execute(), Motionfield::execute(), FutureWorldModelGenerator::executeSingleTransformation(), Potentialfield::getDirectionArray(), Motionfield::getFieldVecFromAStarSearch(), and Motionfield::pathPlanningStillNeeded().

Here is the call graph for this function:

double PfVec::length | ( |  | ) | const`[inline]`

| Returns the length of the vector. Returns: The length Definition at line 95 of file PfieldDatatypes.h. Referenced by computeGradientForPointfield(), computeGradientForSectorfield(), Motionfield::correctMotionVector(), Motionfield::execute(), FutureWorldModelGenerator::executeSingleTransformation(), Potentialfield::getDirectionArray(), FutureWorldModelGenerator::getMaxTranslationForObject(), RandomMotionGenerator::getMotionVector(), intersectGeometricObjects(), normalize(), and Polygon::pointInside().

double PfVec::squareLength | ( |  | ) | const`[inline]`

| Returns the squared length of the vector. Returns: The squared length Definition at line 103 of file PfieldDatatypes.h.

void PfVec::operator= | ( | const PfVec & | v | ) | `[inline]`

  | Assigns another vector. Parameters:
  v | The other vector
Definition at line 111 of file PfieldDatatypes.h. References x, and y.

PfVec PfVec::operator+ | ( | const PfVec & | v | ) | const`[inline]`

  | Adds another vector. Parameters:
  v | The other vector
Returns: The resulting vector Definition at line 121 of file PfieldDatatypes.h. References x, and y.

PfVec PfVec::operator- | ( | const PfVec & | v | ) | const`[inline]`

  | Substracts another vector. Parameters:
  v | The other vector
Returns: The resulting vector Definition at line 133 of file PfieldDatatypes.h. References x, and y.

void PfVec::operator *= | ( | const double & | n | ) | `[inline]`

  | Scales the vector. Parameters:
  n | The scalar
Definition at line 144 of file PfieldDatatypes.h.

PfVec PfVec::operator * | ( | const double & | n | ) | const`[inline]`

  | Returns a scaled vector. Parameters:
  n | The scalar
Returns: The resulting vector Definition at line 154 of file PfieldDatatypes.h.

void PfVec::operator+= | ( | const PfVec & | p | ) | `[inline]`

  | Adds another vector. Parameters:
  p | The other vector
Definition at line 164 of file PfieldDatatypes.h. References x, and y.

void PfVec::operator-= | ( | const PfVec & | p | ) | `[inline]`

  | Substracts another vector. Parameters:
  p | The other vector
Definition at line 173 of file PfieldDatatypes.h. References x, and y.

double PfVec::scalarProduct | ( | const PfVec & | p | ) | const`[inline]`

  | Multiplies with another vector. Parameters:
  p | The other vector
Returns: The inner product Definition at line 183 of file PfieldDatatypes.h. References x, and y. Referenced by intersectLineAndCircle(), Polygon::pointInside(), and pointPerpendicularToLine().

double PfVec::getAngle | ( |  | ) | const`[inline]`

| Computes the angle of the vector. Returns: The angle Definition at line 191 of file PfieldDatatypes.h. Referenced by FutureWorldModelGenerator::executeSingleTransformation(), and PfPose::getAngleTo().

## Member Data Documentation

double PfVec::x

| The x-component. Definition at line 29 of file PfieldDatatypes.h. Referenced by ccw(), PotentialfieldAStarNode::computeHeuristicBetween(), distanceTo(), AStarSearch< PotentialfieldAStarNode, PotentialfieldAStarParameterSet, double >::draw(), Motionfield::execute(), GTStandardConverter::execute(), GT2005PotentialFieldBasicBehaviorAvoidRobots::execute(), GT2005PotentialFieldBasicBehaviorOffensiveSupport::execute(), GT2005PotentialFieldBasicBehaviorSupport::execute(), FutureWorldModelGenerator::executeSingleTransformation(), Potentialfield::getDirectionArray(), Motionfield::getFieldVecFromAStarSearch(), Potentialfield::getValueArray(), PfPose::init(), intersectCircleAndCircle(), intersectLineAndLine(), Motionfield::Motionfield(), operator+(), operator+=(), operator-(), operator-=(), operator=(), Parser::parseGeometricObject(), Parser::parseInstance(), Parser::parseTransformation(), PfPose::PfPose(), pointPerpendicularToLine(), scalarProduct(), GTStandardConverter::setData(), and theta().

double PfVec::y

| The y-component. Definition at line 31 of file PfieldDatatypes.h. Referenced by ccw(), PotentialfieldAStarNode::computeHeuristicBetween(), distanceTo(), AStarSearch< PotentialfieldAStarNode, PotentialfieldAStarParameterSet, double >::draw(), Motionfield::execute(), GTStandardConverter::execute(), GT2005PotentialFieldBasicBehaviorAvoidRobots::execute(), GT2005PotentialFieldBasicBehaviorOffensiveSupport::execute(), GT2005PotentialFieldBasicBehaviorSupport::execute(), FutureWorldModelGenerator::executeSingleTransformation(), Potentialfield::getDirectionArray(), Motionfield::getFieldVecFromAStarSearch(), Potentialfield::getValueArray(), PfPose::init(), intersectCircleAndCircle(), intersectLineAndLine(), Motionfield::Motionfield(), operator+(), operator+=(), operator-(), operator-=(), operator=(), Parser::parseGeometricObject(), Parser::parseInstance(), Parser::parseTransformation(), PfPose::PfPose(), pointPerpendicularToLine(), scalarProduct(), GTStandardConverter::setData(), and theta().

The documentation for this class was generated from the following file:

- Tools/PotentialFields/PfieldDatatypes.h