Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

QVM: Quaternions, Vectors, Matrices

perspective_rh

#include <boost/qvm/mat_operations.hpp>

namespace boost
{
    namespace qvm
    {
        template <class T>
        -unspecified-return-type
        perspective_rh( T fov_y, T aspect, T zn, T zf );
    }
}

Returns:

A 4x4 projection matrix of unspecified type of the following form:

xs             0              0                 0
0              ys             0                 0
0              0         zf/(zn-zf)    zn*zf/(zn-zf)
0              0             -1                 0

where ys=cot(fov_y/2), and xs=ys/aspect.