2#ifndef MATH_RECTANGLE_H
3#define MATH_RECTANGLE_H
27 void set(TYPE l, TYPE t, TYPE r, TYPE b);
74template<
class TYPE>
void
88template<
class TYPE>
bool
91 return (this->left <= x) && (x <= this->right) && (this->top <= y) && (y <= this->bottom);
97template<
class TYPE> TYPE
100 return this->right - this->left;
106template<
class TYPE> TYPE
109 return this->bottom - this->top;
115template<
class TYPE> TYPE
118 return (this->left + this->right) / 2;
124template<
class TYPE> TYPE
127 return (this->top + this->bottom) / 2;
A 2d rectangle class.
Definition rectangle.h:20
TYPE height() const
return height
Definition rectangle.h:107
rectangle()
default constructor
Definition rectangle.h:52
TYPE width() const
return width
Definition rectangle.h:98
bool inside(TYPE x, TYPE y) const
return true if point is inside
Definition rectangle.h:89
TYPE centerX() const
return center x
Definition rectangle.h:116
TYPE top
Definition rectangle.h:40
TYPE centerY() const
return center y
Definition rectangle.h:125
void set(TYPE l, TYPE t, TYPE r, TYPE b)
set content
Definition rectangle.h:75
TYPE right
Definition rectangle.h:41
rectangle(TYPE l, TYPE t, TYPE r, TYPE b)
constructor 1
Definition rectangle.h:61
TYPE bottom
Definition rectangle.h:42
TYPE left
Definition rectangle.h:39
#define n_assert(exp)
Definition debug.h:50
Different curves.
Definition angularpfeedbackloop.h:17
rectangle< float > floatRectangle
Definition rectangle.h:45
rectangle< int > intRectangle
Definition rectangle.h:46