faunus
Public Member Functions | Public Attributes | List of all members
Faunus::QuaternionRotate Class Reference

Rotation routine using the Eigen library. More...

#include <rotate.h>

Public Member Functions

 QuaternionRotate (double angle, Point axis)
 Set angle and rotation axis. More...
 
void set (double angle, Point axis)
 Set angle and rotation axis. More...
 
auto operator() (const Eigen::Matrix3d &matrix) const
 Rotate matrix/tensor. More...
 
const Eigen::Quaterniond & getQuaternion () const
 Get current quaternion.
 
const Eigen::Matrix3d & getRotationMatrix () const
 Get current rotation matrix.
 
Point operator() (Point vector, std::function< void(Point &)> boundary=[](Point &) {}, const Point &shift={0, 0, 0}) const
 Rotate point w. optional PBC boundaries. More...
 

Public Attributes

double angle = 0.0
 Current rotation angle.
 

Detailed Description

Rotation routine using the Eigen library.

Todo:
Get rotate tensors using quaternion

This can rotate vectors and tensors using quaternion and rotation matrix (for matrix rotation).

Constructor & Destructor Documentation

◆ QuaternionRotate()

Faunus::QuaternionRotate::QuaternionRotate ( double  angle,
Point  axis 
)

Set angle and rotation axis.

Parameters
anglerotation angle (radians)
axisrotation axis

Member Function Documentation

◆ operator()() [1/2]

auto Faunus::QuaternionRotate::operator() ( const Eigen::Matrix3d &  matrix) const

Rotate matrix/tensor.

Parameters
matrixMatrix or tensor to rotate
Returns
Rotated matrix or tensor

◆ operator()() [2/2]

QuaternionRotate::Point Faunus::QuaternionRotate::operator() ( Point  r,
std::function< void(Point &)>  boundary = [](Point&) {},
const Point &  shift = {0, 0, 0} 
) const

Rotate point w. optional PBC boundaries.

Parameters
vectorPoint to rotate
boundaryBoundary function to handle PBC
shiftShift used to aid in boundary removal
Returns
Rotated vector

◆ set()

void Faunus::QuaternionRotate::set ( double  angle,
Point  axis 
)

Set angle and rotation axis.

Parameters
anglerotation angle (radians)
axisrotation axis

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