Public Member Functions

fawkes::HomVector Class Reference

A homogeneous vector. More...

#include <geometry/hom_vector.h>

Inheritance diagram for fawkes::HomVector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 HomVector (float x=0, float y=0, float z=0)
 Constructor.
 HomVector (const HomCoord &h)
 Constructor.
virtual ~HomVector ()
 Destructor.
float length () const
 Calculates the length of the vector.
HomVectorset_length (float length)
 Scales the vector such that it has the given length.
HomVectorunit ()
 Brings the vector to unit-length.
float angle_xy (const HomVector &h) const
 Compute the angle between two vectors.

Detailed Description

A homogeneous vector.

Author:
Daniel Beck

Definition at line 31 of file hom_vector.h.


Constructor & Destructor Documentation

fawkes::HomVector::HomVector ( float  x = 0,
float  y = 0,
float  z = 0 
)

Constructor.

Parameters:
x the x-coordinate
y the y-coordinate
z the z-coordinate

Definition at line 41 of file hom_vector.cpp.

fawkes::HomVector::HomVector ( const HomCoord h  ) 

Constructor.

Parameters:
h a HomCoord

Definition at line 49 of file hom_vector.cpp.

References fawkes::HomCoord::w().

fawkes::HomVector::~HomVector (  )  [virtual]

Destructor.

Definition at line 61 of file hom_vector.cpp.


Member Function Documentation

float fawkes::HomVector::angle_xy ( const HomVector v  )  const

Compute the angle between two vectors.

Parameters:
v the other vector
Returns:
the angle (-M_PI ... M_PI)

Definition at line 110 of file hom_vector.cpp.

References length(), fawkes::HomCoord::x(), and fawkes::HomCoord::y().

float fawkes::HomVector::length (  )  const

Calculates the length of the vector.

Returns:
the length

Definition at line 69 of file hom_vector.cpp.

References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().

Referenced by angle_xy(), fawkes::LineSegment::length(), and set_length().

HomVector & fawkes::HomVector::set_length ( float  length  ) 

Scales the vector such that it has the given length.

Parameters:
length the new length
Returns:
reference to a vector with given length

Definition at line 92 of file hom_vector.cpp.

References length(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().

Referenced by fawkes::HomPolar::r(), and unit().

HomVector & fawkes::HomVector::unit (  ) 

Brings the vector to unit-length.

Returns:
a reference to itself

Definition at line 80 of file hom_vector.cpp.

References set_length().

Referenced by fawkes::HomPose2d::HomPose2d().


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