1 #ifndef CARTESIAN_OBJECTS_GROUP
2 #define CARTESIAN_OBJECTS_GROUP
4 /*****************************************************************************\
6 * Name : cartesian objects *
7 * Author : Chris Koeritz *
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 \*****************************************************************************/
21 #include "rectangle.h"
25 //! Provides a geometric point that use double floating points numbers.
27 class cartesian_point : public point<double>
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");
35 static cartesian_point origin() { return cartesian_point(0.0, 0.0); }
36 //!< the origin of the two-dimensional system.
41 //! Provides a geometric line that use double floating points numbers.
43 class cartesian_line : public line<double>
46 cartesian_line(const cartesian_point &endpoint_1,
47 const cartesian_point &endpoint_2)
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) {}
56 //! Provides a geometric rectangle that use double floating points numbers.
58 class cartesian_rectangle : public rectangle<double>
61 cartesian_rectangle(const cartesian_point &vertex_1,
62 const cartesian_point &vertex_2)
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) {}
67 cartesian_rectangle(const rectangle<double> &rect)
68 : rectangle<double>(rect) {}