feisty meow concerns codebase  2.140
triangle.h
Go to the documentation of this file.
1 #ifndef TRIANGLE_CLASS
2 #define TRIANGLE_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : triangle *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 1992-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 
19 
20 // forward.
21 class cartesian_line;
22 class cartesian_point;
23 
24 namespace geometric {
25 
27 
28 class triangle
29 {
30 public:
31  triangle();
32  triangle(const cartesian_point &vertex1, const cartesian_point &vertex2,
33  const cartesian_point &vertex3);
34  triangle(const triangle &to_copy);
35  ~triangle();
36 
37  triangle &operator =(const triangle &to_copy);
38 
39  bool inside(const cartesian_point &where) const;
40 
41  double area() const;
42 
43  line<double> side_1_2() const;
44  line<double> side_2_3() const;
45  line<double> side_3_1() const;
46 
47  cartesian_point vertex_1() const;
48  cartesian_point vertex_2() const;
49  cartesian_point vertex_3() const;
50 
51  void vertex_1(const cartesian_point &to_set);
52  void vertex_2(const cartesian_point &to_set);
53  void vertex_3(const cartesian_point &to_set);
54 
55 protected:
59 };
60 
61 } // namespace.
62 
63 #endif
64 
Provides a geometric point that use double floating points numbers.
Represents a geometric triangle.
Definition: triangle.h:29
line< double > side_1_2() const
Definition: triangle.cpp:55
line< double > side_2_3() const
Definition: triangle.cpp:58
triangle & operator=(const triangle &to_copy)
Definition: triangle.cpp:46
cartesian_point vertex_2() const
Definition: triangle.cpp:66
cartesian_point vertex_1() const
Definition: triangle.cpp:64
cartesian_point _vertex_1
Definition: triangle.h:56
cartesian_point _vertex_3
Definition: triangle.h:58
double area() const
Definition: triangle.cpp:83
cartesian_point vertex_3() const
Definition: triangle.cpp:68
bool inside(const cartesian_point &where) const
Definition: triangle.cpp:76
line< double > side_3_1() const
Definition: triangle.cpp:61
cartesian_point _vertex_2
Definition: triangle.h:57
Contains all of our objects for geometry and avoids name clashes.
Definition: angle.h:25