Skip to content

Minimal three-dimensional vector/point library for C++

License

Notifications You must be signed in to change notification settings

snsinfu/cxx-point

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cxx-point

C++11 Build Status Boost License

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';
}

Installation

Just download point.hpp into your include directory. It is single header-only and has zero dependency.

Testing

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

License

Boost Software License, Version 1.0.