RDK2::Geometry::Point2< Numeric > Struct Template Reference

#include <point2.h>

Inheritance diagram for RDK2::Geometry::Point2< Numeric >:

Inheritance graph
[legend]
Collaboration diagram for RDK2::Geometry::Point2< Numeric >:

Collaboration graph
[legend]

Detailed Description

template<typename Numeric>
struct RDK2::Geometry::Point2< Numeric >

A generic vector with two components.

Note: by design, none of the methods changes the values of the members.

Author:
Andrea Censi <andrea.censi@dis.uniroma1.it>

Daniele Calisi <calisi@dis.uniroma1.it>

Definition at line 44 of file point2.h.


Public Member Functions

 Point2 ()
 Point2 (Numeric x, Numeric y)
 Point2 (const Point2< Numeric > &p)
Point2 operator- (const Point2 &p) const
 Operators.
Point2 operator+ (const Point2 &p) const
Point2operator-= (const Point2 &p)
Point2operator+= (const Point2 &p)
Point2 operator* (const Numeric &n) const
Point2 operator/ (const Numeric &n) const
Numeric operator* (const Point2 &p) const
bool operator== (const Point2 &p) const
bool operator!= (const Point2 &p) const
bool operator< (const Point2 &p) const
double mod () const
 Methods.
double mod2 () const
double abs () const
double norm () const
double distTo2 (const Point2 &p) const
double distTo (const Point2 &p) const
double thetaWith (const Point2 &p) const
Point2 perp () const
Point2 vers () const
double theta () const
Point2 rot (double thetar, const Point2< Numeric > &center=Point2< Numeric >(0, 0)) const
std::string toString () const
std::string outputSpaceSeparated () const

Static Public Member Functions

static Point2 vers (double theta)
 Static methods.
static Point2 min (const Point2 &a, const Point2 &b)
static Point2 max (const Point2 &a, const Point2 &b)

Data Fields

Numeric x
Numeric y

Constructor & Destructor Documentation

template<typename Numeric>
RDK2::Geometry::Point2< Numeric >::Point2 (  )  [inline]

template<typename Numeric>
RDK2::Geometry::Point2< Numeric >::Point2 ( Numeric  x,
Numeric  y 
) [inline]

Definition at line 49 of file point2.h.

template<typename Numeric>
RDK2::Geometry::Point2< Numeric >::Point2 ( const Point2< Numeric > &  p  )  [inline]

Definition at line 50 of file point2.h.


Member Function Documentation

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::operator- ( const Point2< Numeric > &  p  )  const [inline]

Operators.

Subtracts two vectors.

Definition at line 54 of file point2.h.

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::operator+ ( const Point2< Numeric > &  p  )  const [inline]

Adds two vectors.

Definition at line 57 of file point2.h.

template<typename Numeric>
Point2& RDK2::Geometry::Point2< Numeric >::operator-= ( const Point2< Numeric > &  p  )  [inline]

Subtracts two vectors, unary version .

Definition at line 60 of file point2.h.

template<typename Numeric>
Point2& RDK2::Geometry::Point2< Numeric >::operator+= ( const Point2< Numeric > &  p  )  [inline]

Adds two vectors, unary version.

Definition at line 63 of file point2.h.

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::operator* ( const Numeric &  n  )  const [inline]

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::operator/ ( const Numeric &  n  )  const [inline]

Divides components by n.

Definition at line 69 of file point2.h.

template<typename Numeric>
Numeric RDK2::Geometry::Point2< Numeric >::operator* ( const Point2< Numeric > &  p  )  const [inline]

Scalar product.

Definition at line 72 of file point2.h.

template<typename Numeric>
bool RDK2::Geometry::Point2< Numeric >::operator== ( const Point2< Numeric > &  p  )  const [inline]

Checks for equality (not a safe way for not-integer Numeric types: can you feel the evil in this function?)

Definition at line 76 of file point2.h.

template<typename Numeric>
bool RDK2::Geometry::Point2< Numeric >::operator!= ( const Point2< Numeric > &  p  )  const [inline]

Checks for inequality (not a safe way: see above)

Definition at line 79 of file point2.h.

template<typename Numeric>
bool RDK2::Geometry::Point2< Numeric >::operator< ( const Point2< Numeric > &  p  )  const [inline]

This only have sense if you want to have a std::map<Point2<WhatYouLike>, <WhatYouWant> > or something like this

Definition at line 83 of file point2.h.

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::mod (  )  const [inline]

Methods.

Returns L2-norm of vector.

Reimplemented in RDK2::Geometry::Point3< Numeric >, and RDK2::Geometry::Point3< double >.

Definition at line 87 of file point2.h.

Referenced by RDK2::Geometry::Point2< int >::abs(), and RDK2::Geometry::Point2< int >::norm().

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::mod2 (  )  const [inline]

Returns L2-norm of vector, squared.

Reimplemented in RDK2::Geometry::Point3< Numeric >, and RDK2::Geometry::Point3< double >.

Definition at line 90 of file point2.h.

Referenced by RDK2::Geometry::Point2< int >::mod().

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::abs (  )  const [inline]

Returns L2-norm of vector.

Definition at line 93 of file point2.h.

Referenced by RDK2::SensorData::LaserData::isInsideClearArea(), and RDK2::Geometry::PolarPoint::PolarPoint().

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::norm (  )  const [inline]

Returns L2-norm of vector.

Definition at line 96 of file point2.h.

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::distTo2 ( const Point2< Numeric > &  p  )  const [inline]

Returns the squared distance between this point and p.

Definition at line 99 of file point2.h.

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::distTo ( const Point2< Numeric > &  p  )  const [inline]

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::thetaWith ( const Point2< Numeric > &  p  )  const [inline]

Returns the angle of the line that connects this point and p.

Definition at line 105 of file point2.h.

Referenced by RDK2::SensorData::LaserDataTracker::update().

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::perp (  )  const [inline]

Returns a vector perpendicular to this, with the same module.

Definition at line 108 of file point2.h.

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::vers (  )  const [inline]

Returns a versor (= norm 1) parallel to this.

Definition at line 111 of file point2.h.

Referenced by RDK2::Geometry::Point2< int >::vers().

template<typename Numeric>
double RDK2::Geometry::Point2< Numeric >::theta (  )  const [inline]

template<typename Numeric>
Point2 RDK2::Geometry::Point2< Numeric >::rot ( double  thetar,
const Point2< Numeric > &  center = Point2<Numeric>(0, 0) 
) const [inline]

template<typename Numeric>
std::string RDK2::Geometry::Point2< Numeric >::toString (  )  const [inline]

template<typename Numeric>
std::string RDK2::Geometry::Point2< Numeric >::outputSpaceSeparated (  )  const [inline]

Another string representation. Example: " 1 2 ".

Reimplemented in RDK2::Geometry::Point2o< Numeric >, RDK2::Geometry::Point3o< Numeric >, RDK2::Geometry::Point2o< double >, and RDK2::Geometry::Point3o< double >.

Definition at line 136 of file point2.h.

template<typename Numeric>
static Point2 RDK2::Geometry::Point2< Numeric >::vers ( double  theta  )  [inline, static]

Static methods.

Returns a versor of the specified angle

Definition at line 145 of file point2.h.

template<typename Numeric>
static Point2 RDK2::Geometry::Point2< Numeric >::min ( const Point2< Numeric > &  a,
const Point2< Numeric > &  b 
) [inline, static]

Returns a versor with the minima of the components of and .

Definition at line 150 of file point2.h.

template<typename Numeric>
static Point2 RDK2::Geometry::Point2< Numeric >::max ( const Point2< Numeric > &  a,
const Point2< Numeric > &  b 
) [inline, static]

Returns a versor with the maxima of the components of and .

Definition at line 155 of file point2.h.


Field Documentation

template<typename Numeric>
Numeric RDK2::Geometry::Point2< Numeric >::x

Definition at line 46 of file point2.h.

Referenced by RDK2::Geometry::add(), RDK2::Geometry::Viewport::b2w(), RDK2::Geometry::basic_b2w(), RDK2::Geometry::basic_cellBB(), RDK2::RMaps::RMapImage::buf2world(), RDK2::RMaps::RVictimOnMap::computePoseMean(), RDK2::Geometry::CircleWalk::createCirclePoints(), RDK2::Geometry::Point3< double >::cross(), RDK2::Geometry::Viewport::crossesSegment(), RDK2::Geometry::diff(), RDK2::Geometry::difference(), RDK2::RMaps::RMapImage::distMapRayTracing(), RDK2::RGeometry::RPoint2od::equals(), RDK2::Geometry::Viewport::getCellBoundingBox(), RDK2::RMaps::RVictimOnMap::getLogLine(), RDK2::RSensorData::RStereoImageHeightsData::getLogLine(), RDK2::RSensorData::RPantiltData::getLogLine(), RDK2::RSensorData::ROdometryDataWithSpeed::getLogLine(), RDK2::RSensorData::ROdometryData::getLogLine(), RDK2::RSensorData::RLaserData::getLogLine(), RDK2::RMaps::RLandmark::getLogLine(), RDK2::RSensorData::RActuaData::getLogLine(), RDK2::Geometry::LineWalk::getPoint(), RDK2::RGeometry::RPoint2i::getStringForVisualization(), RDK2::RGeometry::RPoint2i::getStringRepresentation(), RDK2::Geometry::getWhiteningMatrix22(), RDK2::Geometry::Viewport::grow(), RDK2::Geometry::Viewport::isInside(), RDK2::Geometry::DMatrix< int >::isInside(), RDK2::Geometry::LineWalk::LineWalk(), RDK2::RSensorData::RStereoImageHeightsData::loadFromLogLine(), RDK2::RSensorData::RPantiltData::loadFromLogLine(), RDK2::RSensorData::ROdometryDataWithSpeed::loadFromLogLine(), RDK2::RSensorData::ROdometryData::loadFromLogLine(), RDK2::RSensorData::RLaserData::loadFromLogLine(), RDK2::RMaps::RLandmark::loadFromLogLine(), RDK2::RSensorData::RActuaData::loadFromLogLine(), RDK2::RGeometry::RPoint2i::loadFromStringRepresentation(), RDK2::Geometry::Point2< int >::max(), RDK2::Geometry::Point2< int >::min(), RDK2::Geometry::mm2m(), RDK2::Geometry::Point3< double >::mod2(), RDK2::Geometry::Point2< int >::mod2(), RDK2::Geometry::DMatrix< int >::next(), RDK2::RMaps::RMapImage::obsDenRayTracing(), RDK2::Geometry::Point3o< double >::operator*(), RDK2::Geometry::Point3< double >::operator*(), RDK2::Geometry::Point2o< double >::operator*(), RDK2::Geometry::Point2< int >::operator*(), RDK2::Geometry::operator*(), RDK2::Geometry::Point3o< double >::operator+(), RDK2::Geometry::Point3< double >::operator+(), RDK2::Geometry::Point2o< double >::operator+(), RDK2::Geometry::Point2< int >::operator+(), RDK2::Geometry::Point2< int >::operator+=(), RDK2::Geometry::Point3o< double >::operator-(), RDK2::Geometry::Point3< double >::operator-(), RDK2::Geometry::Point2o< double >::operator-(), RDK2::Geometry::Point2< int >::operator-(), RDK2::Geometry::Point2< int >::operator-=(), RDK2::Geometry::Point2< int >::operator/(), RDK2::Geometry::Point2< int >::operator<(), RDK2::Geometry::Point3o< double >::operator==(), RDK2::Geometry::Point3< double >::operator==(), RDK2::Geometry::Point2o< double >::operator==(), RDK2::Geometry::Point2< int >::operator==(), RDK2::Geometry::operator>>(), RDK2::Geometry::output(), RDK2::Geometry::outputGaussian(), RDK2::Geometry::outputNormal(), RDK2::Geometry::Point3o< double >::outputSpaceSeparated(), RDK2::Geometry::Point2o< double >::outputSpaceSeparated(), RDK2::Geometry::Point2< int >::outputSpaceSeparated(), RDK2::Geometry::parsePoint(), RDK2::Geometry::Point2< int >::perp(), RDK2::Geometry::Point2o< double >::point2(), RDK2::Geometry::Point3o< double >::point2o(), RDK2::Geometry::projectPointOntoLineOrSegment(), RDK2::Geometry::QuadWalk::QuadWalk(), RDK2::RMaps::RMapImage::rayTracing(), RDK2::RGraphics::RPoseVector::read(), RDK2::Geometry::reassembleFromEig(), RDK2::Geometry::Point2< int >::rot(), RDK2::Geometry::Point2o< double >::rotate(), RDK2::RMaps::RTopologicalFrontier::RTopologicalFrontier(), RDK2::Geometry::sedgewick_ccw(), RDK2::Geometry::Point2< int >::theta(), RDK2::Geometry::Point2< int >::thetaWith(), RDK2::Geometry::Point2o< double >::toGlobalReferenceSystem(), RDK2::Geometry::toGlobalReferenceSystem(), RDK2::Geometry::Point2o< double >::toLocalReferenceSystem(), RDK2::Geometry::toLocalReferenceSystem(), RDK2::RMaps::RMapImage::toString(), RDK2::Geometry::Point3o< double >::toString(), RDK2::Geometry::Point3< double >::toString(), RDK2::Geometry::Point2o< double >::toString(), RDK2::Geometry::Point2< int >::toString(), RDK2::Geometry::Trans3d(), RDK2::SensorData::LaserDataTracker::update(), RDK2::Geometry::Viewport::w2b(), RDK2::Geometry::Viewport::w2b_ani(), RDK2::Geometry::weightedMean(), RDK2::Geometry::Viewport::width(), RDK2::RMaps::RMapImage::world2buf(), and RDK2::SensorData::LaserParser::write().

template<typename Numeric>
Numeric RDK2::Geometry::Point2< Numeric >::y

Definition at line 46 of file point2.h.

Referenced by RDK2::Geometry::add(), RDK2::Geometry::Viewport::b2w(), RDK2::Geometry::basic_b2w(), RDK2::Geometry::basic_cellBB(), RDK2::RMaps::RMapImage::buf2world(), RDK2::RMaps::RVictimOnMap::computePoseMean(), RDK2::Geometry::CircleWalk::createCirclePoints(), RDK2::Geometry::Point3< double >::cross(), RDK2::Geometry::Viewport::crossesSegment(), RDK2::Geometry::diff(), RDK2::Geometry::difference(), RDK2::RMaps::RMapImage::distMapRayTracing(), RDK2::RGeometry::RPoint2od::equals(), RDK2::Geometry::Viewport::getCellBoundingBox(), RDK2::RMaps::RVictimOnMap::getLogLine(), RDK2::RSensorData::RStereoImageHeightsData::getLogLine(), RDK2::RSensorData::RPantiltData::getLogLine(), RDK2::RSensorData::ROdometryDataWithSpeed::getLogLine(), RDK2::RSensorData::ROdometryData::getLogLine(), RDK2::RSensorData::RLaserData::getLogLine(), RDK2::RMaps::RLandmark::getLogLine(), RDK2::RSensorData::RActuaData::getLogLine(), RDK2::Geometry::LineWalk::getPoint(), RDK2::RGeometry::RPoint2i::getStringForVisualization(), RDK2::RGeometry::RPoint2i::getStringRepresentation(), RDK2::Geometry::getWhiteningMatrix22(), RDK2::Geometry::Viewport::grow(), RDK2::Geometry::Viewport::height(), RDK2::Geometry::Viewport::isInside(), RDK2::Geometry::DMatrix< int >::isInside(), RDK2::Geometry::LineWalk::LineWalk(), RDK2::RSensorData::RStereoImageHeightsData::loadFromLogLine(), RDK2::RSensorData::RPantiltData::loadFromLogLine(), RDK2::RSensorData::ROdometryDataWithSpeed::loadFromLogLine(), RDK2::RSensorData::ROdometryData::loadFromLogLine(), RDK2::RSensorData::RLaserData::loadFromLogLine(), RDK2::RMaps::RLandmark::loadFromLogLine(), RDK2::RSensorData::RActuaData::loadFromLogLine(), RDK2::RGeometry::RPoint2i::loadFromStringRepresentation(), RDK2::Geometry::Point2< int >::max(), RDK2::Geometry::Point2< int >::min(), RDK2::Geometry::mm2m(), RDK2::Geometry::Point3< double >::mod2(), RDK2::Geometry::Point2< int >::mod2(), RDK2::Geometry::DMatrix< int >::next(), RDK2::RMaps::RMapImage::obsDenRayTracing(), RDK2::Geometry::Point3o< double >::operator*(), RDK2::Geometry::Point3< double >::operator*(), RDK2::Geometry::Point2o< double >::operator*(), RDK2::Geometry::Point2< int >::operator*(), RDK2::Geometry::operator*(), RDK2::Geometry::Point3o< double >::operator+(), RDK2::Geometry::Point3< double >::operator+(), RDK2::Geometry::Point2o< double >::operator+(), RDK2::Geometry::Point2< int >::operator+(), RDK2::Geometry::Point2< int >::operator+=(), RDK2::Geometry::Point3o< double >::operator-(), RDK2::Geometry::Point3< double >::operator-(), RDK2::Geometry::Point2o< double >::operator-(), RDK2::Geometry::Point2< int >::operator-(), RDK2::Geometry::Point2< int >::operator-=(), RDK2::Geometry::Point2< int >::operator/(), RDK2::Geometry::Point2< int >::operator<(), RDK2::Geometry::Point3o< double >::operator==(), RDK2::Geometry::Point3< double >::operator==(), RDK2::Geometry::Point2o< double >::operator==(), RDK2::Geometry::Point2< int >::operator==(), RDK2::Geometry::operator>>(), RDK2::Geometry::output(), RDK2::Geometry::outputGaussian(), RDK2::Geometry::outputNormal(), RDK2::Geometry::Point3o< double >::outputSpaceSeparated(), RDK2::Geometry::Point2o< double >::outputSpaceSeparated(), RDK2::Geometry::Point2< int >::outputSpaceSeparated(), RDK2::Geometry::parsePoint(), RDK2::Geometry::Point2< int >::perp(), RDK2::Geometry::Point2o< double >::point2(), RDK2::Geometry::Point3o< double >::point2o(), RDK2::Geometry::projectPointOntoLineOrSegment(), RDK2::Geometry::QuadWalk::QuadWalk(), RDK2::RMaps::RMapImage::rayTracing(), RDK2::RGraphics::RPoseVector::read(), RDK2::Geometry::reassembleFromEig(), RDK2::Geometry::Point2< int >::rot(), RDK2::Geometry::Point2o< double >::rotate(), RDK2::RMaps::RTopologicalFrontier::RTopologicalFrontier(), RDK2::Geometry::sedgewick_ccw(), RDK2::Geometry::Point2< int >::theta(), RDK2::Geometry::Point2< int >::thetaWith(), RDK2::Geometry::Point2o< double >::toGlobalReferenceSystem(), RDK2::Geometry::toGlobalReferenceSystem(), RDK2::Geometry::Point2o< double >::toLocalReferenceSystem(), RDK2::Geometry::toLocalReferenceSystem(), RDK2::RMaps::RMapImage::toString(), RDK2::Geometry::Point3o< double >::toString(), RDK2::Geometry::Point3< double >::toString(), RDK2::Geometry::Point2o< double >::toString(), RDK2::Geometry::Point2< int >::toString(), RDK2::Geometry::Trans3d(), RDK2::SensorData::LaserDataTracker::update(), RDK2::Geometry::Viewport::w2b(), RDK2::Geometry::Viewport::w2b_ani(), RDK2::Geometry::weightedMean(), RDK2::RMaps::RMapImage::world2buf(), and RDK2::SensorData::LaserParser::write().


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

Generated on Tue Mar 3 15:05:54 2009 for OpenRDK by  doxygen 1.5.6