Theoretica
Scientific Computing
Loading...
Searching...
No Matches
transform.h File Reference

Linear transformations such as rotations and projective geometry. More...

#include "./algebra.h"
#include "../core/error.h"

Go to the source code of this file.

Namespaces

namespace  theoretica
 Main namespace of the library which contains all functions and objects.
namespace  theoretica::algebra
 Linear algebra routines.

Functions

template<typename Matrix>
Matrix theoretica::algebra::identity (unsigned int rows=0, unsigned int cols=0)
 Returns the identity matrix.
template<typename Vector, typename Matrix>
Matrix & theoretica::algebra::diagonal (Matrix &res, const Vector &v)
 Construct a matrix with the given vector as diagonal and zeroes everywhere else, overwriting the given matrix.
template<typename Matrix, typename Vector>
Matrix theoretica::algebra::diagonal (const Vector &v, unsigned int rows=0, unsigned int cols=0)
 Returns the a matrix with the given diagonal.
template<typename Matrix, typename Vector>
Matrix theoretica::algebra::translation (const Vector &v, unsigned int rows=0, unsigned int cols=0)
 Returns a translation matrix, that is, an NxN matrix which describes a translation in N-1 dimensions.
template<typename Matrix>
Matrix theoretica::algebra::rotation_2d (real theta, unsigned int rows=0, unsigned int cols=0)
 Returns a matrix representing a 2D rotation.
template<typename Matrix, typename Vector>
Matrix theoretica::algebra::rotation_3d (real theta, const Vector &axis, unsigned int rows=0, unsigned int cols=0)
 Returns a matrix representing a 3D rotation around a given axis.
template<typename Matrix>
Matrix theoretica::algebra::rotation_3d_xaxis (real theta, unsigned int rows=0, unsigned int cols=0)
 Returns a matrix representing a 3D rotation around the x axis.
template<typename Matrix>
Matrix theoretica::algebra::rotation_3d_yaxis (real theta, unsigned int rows=0, unsigned int cols=0)
 Returns a matrix representing a 3D rotation around the y axis.
template<typename Matrix>
Matrix theoretica::algebra::rotation_3d_zaxis (real theta, unsigned int rows=0, unsigned int cols=0)
 Returns a matrix representing a 3D rotation around the z axis.
template<typename Matrix>
Matrix theoretica::algebra::perspective (real left, real right, real bottom, real top, real near, real far, unsigned int rows=0, unsigned int cols=0)
 Returns a perspective projection matrix with adjustable view volume boundaries.
template<typename Matrix>
Matrix theoretica::algebra::perspective_fov (real fov, real aspect, real near, real far, unsigned int rows=0, unsigned int cols=0)
 Returns a perspective projection matrix, using the Field of View as parameter.
template<typename Matrix>
Matrix theoretica::algebra::ortho (real left, real right, real bottom, real top, real near, real far, unsigned int rows=0, unsigned int cols=0)
 Returns an orthogonal projection matrix.
template<typename Matrix, typename Vector1, typename Vector2, typename Vector3>
Matrix theoretica::algebra::look_at (Vector1 camera, Vector2 target, Vector3 up)
 Return a transformation matrix that points the field of view towards a given point from the <camera> point.
template<typename Matrix>
Matrix theoretica::algebra::symplectic (unsigned int rows=0, unsigned int cols=0)
 Generate a NxN symplectic matrix where N is even.
template<typename Matrix>
Matrix theoretica::algebra::hilbert (unsigned int rows=0)
 Construct the Hilbert matrix of arbitrary dimension.
template<typename Vector1, typename Vector2>
Vector1 theoretica::algebra::sphere_inversion (const Vector1 &p, const Vector2 &c, real r=1)
 Sphere inversion of a point with respect to a sphere of radius r centered at a point c.

Detailed Description

Linear transformations such as rotations and projective geometry.