Theoretica
A C++ numerical and automatic mathematical library
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

 theoretica
 Main namespace of the library which contains all functions and objects.
 
 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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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.
 
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. More...
 
template<typename Vector1 , typename Vector2 >
Vector1 theoretica::algebra::sphere_inversion (const Vector1 &p, const Vector2 &c=Vector2(0), real r=1)
 Sphere inversion of a point with respect to a sphere of radius r centered at a point c. More...
 

Detailed Description

Linear transformations such as rotations and projective geometry.