// // common.hpp // math // // Created by Sam Jaffe on 8/20/16. // #pragma once #include "math_fwd.hpp" namespace math { vec2 rotate(vec2 const & point, radian r); vec2 rotate(vec2 const & center, vec2 const & point, radian r); dim2::quad rotate(vec2 const & center, dim2::quad const & q, radian r); bool contains(dim2::line const & shape, dim2::point const & pt); bool contains(dim2::circle const & shape, dim2::point const & pt); bool contains(dim2::quad const & shape, dim2::point const & pt); bool intersects(dim2::line const & lhs, dim2::line const & rhs); bool intersects(dim2::line const & lhs, dim2::circle const & rhs); bool intersects(dim2::line const & lhs, dim2::quad const & rhs); bool intersects(dim2::quad const & lhs, dim2::line const & rhs); bool intersects(dim2::quad const & lhs, dim2::circle const & rhs); bool intersects(dim2::quad const & lhs, dim2::quad const & rhs); bool intersects(dim2::circle const & lhs, dim2::line const & rhs); bool intersects(dim2::circle const & lhs, dim2::quad const & rhs); bool intersects(dim2::circle const & lhs, dim2::circle const & rhs); } namespace math { inline bool intersects(dim2::quad const & lhs, dim2::line const & rhs) { return intersects(rhs, lhs); } inline bool intersects(dim2::circle const & lhs, dim2::line const & rhs) { return intersects(rhs, lhs); } inline bool intersects(dim2::circle const & lhs, dim2::quad const & rhs) { return intersects(rhs, lhs); } }