1#ifndef RIVET_MATH_MATRIX3
2#define RIVET_MATH_MATRIX3
4#include "Rivet/Math/MathConstants.hh"
5#include "Rivet/Math/MathUtils.hh"
6#include "Rivet/Math/MatrixN.hh"
7#include "Rivet/Math/Vector3.hh"
13 class Matrix3 :
public Matrix<3> {
17 Matrix3(
const Matrix<3>& m3) : Matrix<3>::Matrix(m3) { }
21 _matrix = RivetEigen::AngleAxis<double>(
angle, normaxis._vec);
25 setAsRotation(from, to);
28 static Matrix3 mkXRotation(
const double angle) {
32 static Matrix3 mkYRotation(
const double angle) {
36 static Matrix3 mkZRotation(
const double angle) {
41 const double theta =
angle(from, to);
43 _matrix = EMatrix::Identity();
46 _matrix = RivetEigen::AngleAxis<double>(theta, normaxis._vec);
51 static Matrix3 mkRotation(
const Vector3& from,
const Vector3& to) {
53 rtn.setAsRotation(from, to);
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
Vector3 unit() const
Synonym for unitVec.
Definition Vector3.hh:124
Definition MC_CENT_PPB_Projections.hh:10
std::enable_if_t< std::is_floating_point_v< NUM >, bool > isZero(NUM val, double tolerance=1e-8)
Compare a number to zero.
Definition MathUtils.hh:24
Vector3 cross(const Vector3 &a, const Vector3 &b)
Unbound cross-product function.
Definition Vector3.hh:282
double angle(const Vector2 &a, const Vector2 &b)
Angle (in radians) between two 2-vectors.
Definition Vector2.hh:177