Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::Rotate Class Reference

Rotation around the origin. More...

#include <transforms.h>

Inheritance diagram for Geom::Rotate:
Geom::TransformOperations< Rotate >

Public Member Functions

 Rotate ()=default
 Construct a zero-degree rotation.
 
 Rotate (Coord theta)
 Construct a rotation from its angle in radians.
 
 Rotate (Point const &p)
 Construct a rotation from its characteristic vector.
 
 Rotate (Coord x, Coord y)
 Construct a rotation from the coordinates of its characteristic vector.
 
 operator Affine () const
 
Point const & vector () const
 Get the characteristic vector of the rotation.
 
Coord angle () const
 
Coord operator[] (Dim2 dim) const
 
Coord operator[] (unsigned dim) const
 
Rotateoperator*= (Rotate const &o)
 
bool operator== (Rotate const &o) const
 
Rotate inverse () const
 
- Public Member Functions inherited from Geom::TransformOperations< Rotate >
Affine operator* (T2 const &t) const
 

Static Public Member Functions

static Rotate identity ()
 Get a zero-degree rotation.
 
static Rotate from_degrees (Coord deg)
 Construct a rotation from its angle in degrees.
 
static Affine around (Point const &p, Coord angle)
 

Private Attributes

Point vec = { 1, 0 }
 

Friends

class Point
 

Detailed Description

Rotation around the origin.

Combine with translations to the origin and back to get a rotation around a different point.

Definition at line 185 of file transforms.h.

Constructor & Destructor Documentation

◆ Rotate() [1/4]

Geom::Rotate::Rotate ( )
default

Construct a zero-degree rotation.

Referenced by around(), and from_degrees().

◆ Rotate() [2/4]

Geom::Rotate::Rotate ( Coord  theta)
inlineexplicit

Construct a rotation from its angle in radians.

Positive arguments correspond to counter-clockwise rotations (if Y grows upwards).

Definition at line 194 of file transforms.h.

◆ Rotate() [3/4]

Geom::Rotate::Rotate ( Point const &  p)
inlineexplicit

Construct a rotation from its characteristic vector.

Definition at line 196 of file transforms.h.

◆ Rotate() [4/4]

Geom::Rotate::Rotate ( Coord  x,
Coord  y 
)
inlineexplicit

Construct a rotation from the coordinates of its characteristic vector.

Definition at line 198 of file transforms.h.

Member Function Documentation

◆ angle()

◆ around()

Affine Geom::Rotate::around ( Point const &  p,
Coord  angle 
)
static

Definition at line 142 of file transforms.cpp.

References angle(), result, and Rotate().

◆ from_degrees()

◆ identity()

static Rotate Geom::Rotate::identity ( )
inlinestatic

Get a zero-degree rotation.

Definition at line 215 of file transforms.h.

Referenced by Geom::check_transforms().

◆ inverse()

◆ operator Affine()

Geom::Rotate::operator Affine ( ) const
inline

Definition at line 199 of file transforms.h.

References vec, Geom::X, and Geom::Y.

◆ operator*=()

Rotate & Geom::Rotate::operator*= ( Rotate const &  o)
inline

Definition at line 207 of file transforms.h.

References vec.

◆ operator==()

bool Geom::Rotate::operator== ( Rotate const &  o) const
inline

Definition at line 208 of file transforms.h.

References vec.

◆ operator[]() [1/2]

Coord Geom::Rotate::operator[] ( Dim2  dim) const
inline

Definition at line 205 of file transforms.h.

References vec.

◆ operator[]() [2/2]

Coord Geom::Rotate::operator[] ( unsigned  dim) const
inline

Definition at line 206 of file transforms.h.

References vec.

◆ vector()

Point const & Geom::Rotate::vector ( ) const
inline

Get the characteristic vector of the rotation.

Returns
A vector that would be obtained by applying this transform to the X versor.

Definition at line 203 of file transforms.h.

References vec.

Friends And Related Symbol Documentation

◆ Point

friend class Point
friend

Definition at line 221 of file transforms.h.

Referenced by inverse().

Member Data Documentation

◆ vec

Point Geom::Rotate::vec = { 1, 0 }
private

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