Minimal three-dimensional vector/point library for C++11 and later. No geometric algorithm or linear algebra; just vectors and points. API docs.
#include <iostream>
#include "point.hpp"
int main()
{
cxx::point pa = {2, 4, 8};
cxx::point pb = {3, 5, 7};
cxx::vector r1 = pa - pb;
cxx::vector r2 = {1, 6, 9};
std::cout << r1.cross(r2).normalize() << '\n';
}
Just download point.hpp into your include directory. It is single header-only and has zero dependency.
Tests require a C++11 compiler with gcc-compatible command line options.
git clone https://github.com/snsinfu/cxx-point
cd cxx-point/tests
make
Boost Software License, Version 1.0.