Core 1.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
Frame2 Class Reference

Solid transformations in the plane. More...

#include <frame.h>

Inheritance diagram for Frame2:
OrientedBox2

Public Member Functions

 Frame2 (const Matrix2 &=Matrix2::Identity, const Vector2 &=Vector2::Null)
 Creates a frame given a rotation matrix and a translation vector. More...
 
 Frame2 (const Vector2 &, const Vector2 &, const Vector2 &)
 Creates a frame given the origin and its orthogonal unit vectors. More...
 
 ~Frame2 ()
 Empty.
 
Matrix2 R () const
 Returns the rotation matrix of the frame.
 
Vector2 T () const
 Returns the translation vector of the frame.
 
Vector2 GetVector (int) const
 Returns the i-th basis vector of the frame. More...
 
void Compose (const Frame2 &)
 Compose the frame with another one. More...
 
Frame2 Composed (const Frame2 &) const
 Compose the frame with another one. More...
 
Frame2 Inverse () const
 Compute the inverse transformation.
 
Vector2 Transform (const Vector2 &) const
 Transform a point out of the frame coordinate system. More...
 
Vector2 InverseTransform (const Vector2 &) const
 Transform a point into the frame coordinate system. More...
 
Vector2 TransformDirection (const Vector2 &) const
 Transform a direction vector out of the frame coordinate system. More...
 
Vector2 InverseTransformDirection (const Vector2 &) const
 Transform a direction vector into the frame coordinate system.
 

Static Public Member Functions

static Frame2 Translation (const Vector2 &)
 Creates a translation transformation. More...
 
static Frame2 Rotation (const double &)
 Create a rotation frame about an arbitrary axis. More...
 

Static Public Attributes

static const Frame2 Id
 Identity.
 

Protected Attributes

Matrix2 r
 Rotation matrix.
 
Vector2 t
 Translation vector.
 

Friends

std::ostream & operator<< (std::ostream &, const Frame2 &)
 Overloaded. More...
 

Detailed Description

Solid transformations in the plane.

See also
Frame

Constructor & Destructor Documentation

◆ Frame2() [1/2]

Frame2::Frame2 ( const Matrix2 r = Matrix2::Identity,
const Vector2 t = Vector2::Null 
)
explicit

Creates a frame given a rotation matrix and a translation vector.

Parameters
rFrame matrix.
tTranslation vector.

◆ Frame2() [2/2]

Frame2::Frame2 ( const Vector2 c,
const Vector2 x,
const Vector2 y 
)
explicit

Creates a frame given the origin and its orthogonal unit vectors.

Parameters
cOrigin.
x,yOrthonormal vectors.

Member Function Documentation

◆ Compose()

void Frame2::Compose ( const Frame2 frame)

Compose the frame with another one.

Parameters
frameThe frame.

◆ Composed()

Frame2 Frame2::Composed ( const Frame2 frame) const

Compose the frame with another one.

Parameters
frameThe frame.

◆ GetVector()

Vector2 Frame2::GetVector ( int  i) const
inline

Returns the i-th basis vector of the frame.

This is a convenience function, which is the same as:

Frame frame;
Vector y=frame.R().C(1); // Get rotation matrix, and then column vector.
Solid transformations.
Definition: frame.h:11
Matrix R() const
Returns the rotation matrix of the frame.
Definition: frame.h:68
Vector C(int) const
Get the i-th column vector of the matrix.
Definition: matrix.h:202
Vectors in three dimensions.
Definition: evector.h:21
Parameters
iColumn index.

◆ InverseTransform()

Vector2 Frame2::InverseTransform ( const Vector2 p) const
inline

Transform a point into the frame coordinate system.

Parameters
pPoint.

◆ Rotation()

Frame2 Frame2::Rotation ( const double &  angle)
static

Create a rotation frame about an arbitrary axis.

Parameters
angleAngle (should be in radian).

◆ Transform()

Vector2 Frame2::Transform ( const Vector2 p) const
inline

Transform a point out of the frame coordinate system.

Parameters
pPoint.

◆ TransformDirection()

Vector2 Frame2::TransformDirection ( const Vector2 n) const
inline

Transform a direction vector out of the frame coordinate system.

Parameters
nVector.

◆ Translation()

Frame2 Frame2::Translation ( const Vector2 t)
static

Creates a translation transformation.

Matrix is identity whereas the translation vector is computed from the argument vector.

Parameters
tTranslation vector.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Frame2 frame 
)
friend

Overloaded.

Parameters
sStream.
frameThe frame.