Core 1.0
Frame2 Class Reference

Solid transformations in the plane. More...

#include <frame.h>

Inheritance diagram for Frame2:
FrameScaled2 OrientedBox2

Public Member Functions

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

Static Public Member Functions

static Frame2 Translation (const Vector2 &)
 Creates a translation transformation.
 
static Frame2 Rotation (const double &)
 Create a rotation frame.
 

Static Public Attributes

static const Frame2 Id
 Identity.
 

Protected Attributes

Matrix2 r
 Rotation matrix.
 
Vector2 t
 Translation vector.
 

Friends

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

Detailed Description

Solid transformations in the plane.

See also
Frame

Constructor & Destructor Documentation

◆ Frame2() [1/3]

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

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

Parameters
rFrame matrix.
tTranslation vector.

◆ Frame2() [2/3]

Frame2::Frame2 ( const double & a,
const Vector2 & t = Vector2::Null )
explicit

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

Parameters
aAngle.
tTranslation vector.

◆ Frame2() [3/3]

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

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

Parameters
cOrigin.
xAxis, the orthonormal vectors will be set as (x,x&#10178;).

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.

◆ Draw()

void Frame2::Draw ( QGraphicsScene & scene,
const QPen & pen ) const

Draw a circle.

Parameters
sceneGraphics scene.
penThe pen.

◆ 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.

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 Symbol Documentation

◆ operator<<

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

Overloaded.

Parameters
sStream.
frameThe frame.