feisty meow concerns codebase  2.140
cartesian_objects.h
Go to the documentation of this file.
1 #ifndef CARTESIAN_OBJECTS_GROUP
2 #define CARTESIAN_OBJECTS_GROUP
3 
4 /*****************************************************************************\
5 * *
6 * Name : cartesian objects *
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 #include "angle.h"
19 #include "line.h"
20 #include "point.h"
21 #include "rectangle.h"
22 
23 namespace geometric {
24 
26 
27 class cartesian_point : public point<double>
28 {
29 public:
30  cartesian_point(double x = 0, double y = 0) : point<double>(x, y) {}
31  cartesian_point(double r, double_angle theta) : point<double>(r, theta) {}
32  cartesian_point(const point<double> &to_copy) : point<double>(to_copy) {}
33  DEFINE_CLASS_NAME("cartesian_point");
34 
35  static cartesian_point origin() { return cartesian_point(0.0, 0.0); }
37 };
38 
40 
42 
43 class cartesian_line : public line<double>
44 {
45 public:
48  : line<double>(endpoint_1, endpoint_2) {}
49  cartesian_line(double x_1 = 0, double y_1 = 0,
50  double x_2 = 0, double y_2 = 0)
51  : line<double>(x_1, y_1, x_2, y_2) {}
52 };
53 
55 
57 
58 class cartesian_rectangle : public rectangle<double>
59 {
60 public:
63  : rectangle<double>(vertex_1, vertex_2) {}
64  cartesian_rectangle(double x_1 = 0, double y_1 = 0,
65  double x_2 = 0, double y_2 = 0)
66  : rectangle<double>(x_1, y_1, x_2, y_2) {}
68  : rectangle<double>(rect) {}
69 };
70 
71 } // namespace.
72 
73 #endif
74 
Provides a geometric line that use double floating points numbers.
cartesian_line(double x_1=0, double y_1=0, double x_2=0, double y_2=0)
cartesian_line(const cartesian_point &endpoint_1, const cartesian_point &endpoint_2)
Provides a geometric point that use double floating points numbers.
cartesian_point(const point< double > &to_copy)
cartesian_point(double x=0, double y=0)
cartesian_point(double r, double_angle theta)
static cartesian_point origin()
the origin of the two-dimensional system.
DEFINE_CLASS_NAME("cartesian_point")
Provides a geometric rectangle that use double floating points numbers.
cartesian_rectangle(const cartesian_point &vertex_1, const cartesian_point &vertex_2)
cartesian_rectangle(double x_1=0, double y_1=0, double x_2=0, double y_2=0)
cartesian_rectangle(const rectangle< double > &rect)
double_angle provides a non-templated class for forward declarations.
Definition: angle.h:97
Represents a geometric line segment.
Definition: line.h:26
point< double > endpoint_2() const
Definition: line.h:119
point< double > endpoint_1() const
Definition: line.h:115
Represents a geometric point.
Definition: point.h:37
double r() const
Definition: point.h:122
double x() const
Definition: point.h:47
double y() const
Definition: point.h:48
double_angle theta() const
Definition: point.h:140
Represents a geometric rectangle.
Definition: rectangle.h:28
point< double > vertex_1() const
Definition: rectangle.h:148
point< double > vertex_2() const
Definition: rectangle.h:152
Contains all of our objects for geometry and avoids name clashes.
Definition: angle.h:25