1 #ifndef PIXLED_GEOMETRY_H
2 #define PIXLED_GEOMETRY_H
13 static const float PI = 3.14159265358979323846f;
59 angle(
float value) : value(value) {}
91 return value * 180.f /
PI;
122 angle
operator+(
const angle& a,
const angle& b);
129 angle
operator-(
const angle& a,
const angle& b);
340 : a(a), b(b), center(center) {}
Definition: geometry.h:52
friend angle operator+(const angle &, const angle &)
Definition: geometry.cpp:15
friend angle operator-(const angle &, const angle &)
Definition: geometry.cpp:19
float toRad() const
Definition: geometry.h:81
static angle fromRad(float value)
Definition: geometry.cpp:8
float toDeg() const
Definition: geometry.h:90
static angle fromDeg(float value)
Definition: geometry.cpp:11
angle & operator-=(const angle &a)
Definition: geometry.h:111
angle & operator+=(const angle &a)
Definition: geometry.h:100
Definition: geometry.h:296
void stretchTo(point p)
Definition: geometry.cpp:80
bounding_box()
Definition: geometry.cpp:74
Definition: geometry.h:247
point position() const
Definition: geometry.h:281
box()
Definition: geometry.cpp:70
point _position
Definition: geometry.h:252
coordinate height() const
Definition: geometry.h:289
coordinate _width
Definition: geometry.h:256
coordinate width() const
Definition: geometry.h:285
coordinate _height
Definition: geometry.h:260
Definition: geometry.h:325
spiral(float a, float b, point center)
Definition: geometry.h:339
point operator()(angle theta)
Definition: geometry.cpp:102
Definition: animation.cpp:3
arithmetic::Minus< typename std::common_type< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type >::type, typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator-(Arg1 &&f1, Arg2 &&f2)
Definition: arithmetic.h:182
float tan(const angle &a)
Definition: geometry.cpp:65
float distance(const point &p1, const point &p2)
Definition: geometry.cpp:4
float coordinate
Definition: geometry.h:18
float sin(const angle &a)
Definition: geometry.cpp:61
std::ostream & operator<<(std::ostream &o, const point &p)
Definition: geometry.cpp:52
arithmetic::Plus< typename std::common_type< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type >::type, typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator+(Arg1 &&f1, Arg2 &&f2)
Definition: arithmetic.h:60
static const float PI
Definition: geometry.h:13
bool operator==(const color &c1, const color &c2)
Definition: color.cpp:181
float cos(const angle &a)
Definition: geometry.cpp:57
Definition: geometry.h:134
coordinate b
Definition: geometry.h:142
coordinate c
Definition: geometry.h:146
coordinate a
Definition: geometry.h:138
line(coordinate a, coordinate b, coordinate c)
Definition: geometry.h:154
Definition: geometry.h:199
bool operator()(const point &p1, const point &p2) const
Definition: geometry.cpp:48
Definition: geometry.h:171
std::size_t operator()(const point &p) const
Definition: geometry.cpp:38
Definition: geometry.h:23
coordinate x
Definition: geometry.h:27
point()
Definition: geometry.h:37
point(coordinate x, coordinate y)
Definition: geometry.h:45
coordinate y
Definition: geometry.h:31