# What are some standard mathematical tests for projection matrices?

I'm trying to double check my math in my projection matrices. I'm thinking about "unit tests" when I ask this. I'm looking for 4 or 5 unit tests that would be appropriate to give one confidence that the projections are correct.

This is a little more than an obvious question. Let me explain... When I did this with a quaternion, the potential tests were very logical. The perspective transforms by comparison are somewhat non-intuitive. For a quaternion, if I start with the unit Y vector {0.0, 1.0, 0.0} and I rotate it a quarter turn about the x-axis, I know that the answer is the unit vector in the negative z direction. It's a logical answer. Is there something equally logical/obvious for orthographic and perspective projections?

I've gone through many math books and many tutorials over the years. I'd like to once and for all "prove" that my ortho and perspective matrices are always projecting correctly.

If I composed an ortho matrix using left, right, bottom, top, near, far as follows:

              0.0f, 1.0f,
0.0f, 1.0f,
0.0f, 1.0f


I might get the following matrix (right-handed / OpenGL style)

  2.000000,   0.000000,   0.000000,  -1.000000
0.000000,   2.000000,   0.000000,  -1.000000
0.000000,   0.000000,  -2.000000,  -1.000000
0.000000,   0.000000,   0.000000,   1.000000


I'd like to know if that matrix is computed correctly.

Then for a test, I'd multiply a vertex such as {1.0f, 1.0f, 0.0f} against the matrix and get back {1.0f, 1.0f, -1.0f}. Is it correct? ...and I'd like to do that on several standard points.

I'm having trouble visualizing "standard" or "logical" tests for this. Something that at a glance, just makes sense. (like the quaternion example above)