summary refs log tree commit diff stats
path: root/triangle.h
diff options
context:
space:
mode:
Diffstat (limited to 'triangle.h')
-rw-r--r--triangle.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/triangle.h b/triangle.h new file mode 100644 index 0000000..08753ed --- /dev/null +++ b/triangle.h
@@ -0,0 +1,32 @@
1#ifndef TRIANGLE_H_696E06A8
2#define TRIANGLE_H_696E06A8
3
4#include "matrix3x3.h"
5
6class Triangle {
7 public:
8 Triangle(double x0, double y0, double x1, double y1, double x2, double y2);
9
10 bool in_bounds(double x, double y) const;
11 void random_point(double& x, double& y) const;
12 void random_vertex(double& x, double& y) const;
13
14 double getX0() const;
15 double getX1() const;
16 double getX2() const;
17 double getY0() const;
18 double getY1() const;
19 double getY2() const;
20
21 private:
22 double x0, x1, x2;
23 double y0, y1, y2;
24 double minx, miny, maxx, maxy;
25 double a1, a2, a3;
26 double b1, b2, b3;
27 double c1, c2, c3;
28};
29
30Matrix3x3 affineTransform(Triangle from, Triangle to);
31
32#endif /* end of include guard: TRIANGLE_H_696E06A8 */