diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-02 22:57:13 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-02 22:57:13 -0400 |
commit | 330f75e663c22e1198a92fd134865ada98c3957b (patch) | |
tree | b78f8aa762fcc93c14a0905546b694cddaaa3041 /triangle.h | |
download | infinite-330f75e663c22e1198a92fd134865ada98c3957b.tar.gz infinite-330f75e663c22e1198a92fd134865ada98c3957b.tar.bz2 infinite-330f75e663c22e1198a92fd134865ada98c3957b.zip |
Initial commit
Diffstat (limited to 'triangle.h')
-rw-r--r-- | triangle.h | 32 |
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 | |||
6 | class 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 | |||
30 | Matrix3x3 affineTransform(Triangle from, Triangle to); | ||
31 | |||
32 | #endif /* end of include guard: TRIANGLE_H_696E06A8 */ | ||