26 #include <boost/geometry/geometries/point_xy.hpp> 29 #define M_PI 3.14159265358979323846 34 typedef boost::geometry::model::d2::point_xy<float>
Point;
36 template <
class T>
inline T
sqr(T x) {
return x*x;}
39 static const float M_PI = 3.1415926535f;
57 return Point(
x(x1,y1),
y(x1,y1));}
71 Point c1=r(-1,0), c2=r(0,1);
72 Point r1=r(c1.x(), c2.x()), r2=r(c1.y(),c2.y());
78 float x(
float x,
float y)
const {
81 float y(
float x,
float y)
const {
91 x+=(size_t(-x)/360+1)*360;
92 return std::fmod(x,360);
104 const double fm=std::fmod(rotation,360);
105 return std::abs(fm)>90 && std::abs(fm)<270;
#define M_PI
some useful geometry types, defined from boost::geometry
bool initialisedFrom(float rot, float x, float y) const
static constexpr float rad
Point operator()(const Point &p) const
float y(float x, float y) const
Rotate(float rot, float x0, float y0)
rotate (x,y) by rot (in degrees) around the origin (x0, y0) can be used for rotating multiple points ...
Point operator()(float x1, float y1) const
rotate (x1,y1)
bool flipped(double rotation)
returns if the angle (in degrees) is in the second or third quadrant
float x(float x, float y) const
Reflect(float angle=0, float x0=0, float y0=1)
int quadrant(double x)
return quadrant x is in: 0=[-45,45),1=[45,135), etc
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
boost::geometry::model::d2::point_xy< float > Point
double clamp360(double x)
return x modulo 360
float y(float x, float y) const
float x(float x, float y) const