Geometric Test Library

For solving those pesky 3D math problems.


Solves 2D and 3D math problems, including, closest point, intersection, line of sight and reflection vector in C++. Each primitive is built from mathematical definitions, so these tests are designed to be used with any C++ application or game engine.


  • Closest Point in AABB
  • Closest Point on a Ray
  • Closest Point on a Plane
  • Closest Point on a Sphere
  • Intersection of a Ray and Triangle
  • Intersection of Two Rays in 3D
  • Intersection of Dynamic Sphere and Stationary Plane
  • Intersection of Three Planes
And many more!

Get the project now! It is hosted on GitHub under an Apache 2.0 license.

Video Tutorials

Come learn how to build geometric primitives and then use them to perform closest point and intersection tests.

Vectors, Formulas, and Geometric Primitives

Overview of vector math and an example of how primitives can be built in C++.

Learn more on GitHub

How to Find the Closest Point

Using what we've built so far, we perform closest point tests for AABBs, planes, rays, and spheres.

Learn more on GitHub