23#ifndef VCL_MATH_TRANSFORM_H
24#define VCL_MATH_TRANSFORM_H
28#include <vclib/concepts/space/matrix.h>
29#include <vclib/concepts/space/point.h>
48template<MatrixConcept MatrixType, Po
int3Concept Po
intType,
typename ScalarType>
58 matrix(0, 0) = axis[0] * axis[0] *
q + c;
59 matrix(0, 1) = axis[0] * axis[1] *
q - axis[2] * s;
60 matrix(0, 2) = axis[0] * axis[2] *
q + axis[1] * s;
61 matrix(1, 0) = axis[1] * axis[0] *
q + axis[2] * s;
62 matrix(1, 1) = axis[1] * axis[1] *
q + c;
63 matrix(1, 2) = axis[1] * axis[2] *
q - axis[0] * s;
64 matrix(2, 0) = axis[2] * axis[0] *
q - axis[1] * s;
65 matrix(2, 1) = axis[2] * axis[1] *
q + axis[0] * s;
66 matrix(2, 2) = axis[2] * axis[2] *
q + c;
84template<MatrixConcept MatrixType, Po
int3Concept Po
intType,
typename ScalarType>
108template<MatrixConcept MatrixType, Po
int3Concept Po
intType>
115 matrix.block(0, 0, 3, 3).setIdentity();
119 auto angle = std::acos(
124template<MatrixConcept MatrixType, Po
int3Concept Po
intType>
125void setTransformMatrixTranslation(
127 const PointType& translation)
129 matrix(0, 3) = translation[0];
130 matrix(1, 3) = translation[1];
131 matrix(2, 3) = translation[2];
134template<MatrixConcept MatrixType,
typename ScalarType>
135void setTransformMatrixScale(MatrixType& matrix,
const ScalarType& scale)
137 matrix(0, 0) = scale;
138 matrix(1, 1) = scale;
139 matrix(2, 2) = scale;
143template<MatrixConcept MatrixType, Po
int3Concept Po
intType>
144void setTransformMatrixScale(MatrixType& matrix,
const PointType& scale)
146 matrix(0, 0) = scale[0];
147 matrix(1, 1) = scale[1];
148 matrix(2, 2) = scale[2];
167template<MatrixConcept MatrixType, Po
int3Concept Po
intType,
typename ScalarType>
192template<MatrixConcept MatrixType, Po
int3Concept Po
intType,
typename ScalarType>
213template<MatrixConcept MatrixType, Po
int3Concept Po
intType>
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
void setTransformMatrixRotation(MatrixType &matrix, PointType axis, const ScalarType &angleRad)
Given an 3D axis and an angle expressed in radiants, fills the given matrix with a transform matrix t...
Definition transform.h:49
Scalar toRad(const Scalar °)
Converts an angle in degrees to radians.
Definition base.h:83
MatrixType rotationMatrixDeg(const PointType &axis, const ScalarType &angleDeg)
Given an 3D axis and an angle expressed in degrees, fills the given matrix with a transform matrix th...
Definition transform.h:193
void setTransformMatrixRotationDeg(MatrixType &matrix, PointType axis, const ScalarType &angleDeg)
Given an 3D axis and an angle expressed in degrees, fills the given matrix with a transform matrix th...
Definition transform.h:85
MatrixType rotationMatrix(const PointType &axis, const ScalarType &angleRad)
Given an 3D axis and an angle expressed in radiants, returns a transform matrix that represents the r...
Definition transform.h:168