roliveira / rpoint

A c++ header-only library for points
MIT License
1 stars 0 forks source link

Direction from rpoint coordinates. #2

Closed roliveira closed 7 years ago

roliveira commented 7 years ago

All the tools are there, just need to pretend it's a vector...

RPoint<T> dir(RPoint<T> p)
    return part->vdir = (
        p / std::sqrt(
            rpoint::sum(
                rpoint::pow(p, 2)
            )
        )
    ).to<int>();
roliveira commented 7 years ago

Added in #3.