]> git.tdb.fi Git - libs/math.git/blob - source/geometry/rectangle.h
296ba6c936c959dcb94bb0174b2a1457bd23b562
[libs/math.git] / source / geometry / rectangle.h
1 #ifndef MSP_GEOMETRY_RECTANGLE_H_
2 #define MSP_GEOMETRY_RECTANGLE_H_
3
4 #include <msp/linal/vector2.h>
5 #include "hyperbox.h"
6
7 namespace Msp {
8 namespace Geometry {
9
10 template<typename T>
11 class Rectangle: public HyperBox<T, 2>
12 {
13 public:
14         Rectangle() { }
15         explicit Rectangle(const LinAl::Vector<T, 2> &d): HyperBox<T, 2>(d) { }
16         Rectangle(T w, T h): HyperBox<T, 2>(LinAl::Vector2<T>(w, h)) { }
17
18         T get_width() const { return this->get_dimension(0); }
19         T get_height() const { return this->get_dimension(1); }
20 };
21
22 } // namespace Geometry
23 } // namespace Msp
24
25 #endif