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