Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Rectangle.cpp
Go to the documentation of this file.
1
19
20namespace Elements {
21namespace Examples {
22
23Rectangle::Rectangle(int X0, int Y0, int X1, int Y1) {
24 x0 = X0;
25 y0 = Y0;
26 x1 = X1;
27 y1 = Y1;
28}
29
31
33 return (x1 - x0);
34}
35
37 return (y1 - y0);
38}
39
41 return (x1 - x0) * (y1 - y0);
42}
43
44void Rectangle::move(int dx, int dy) {
45 x0 += dx;
46 y0 += dy;
47 x1 += dx;
48 y1 += dy;
49}
50
51} // namespace Examples
52} // namespace Elements
Rectangle(int xl, int yl, int xu, int yu)
Definition: Rectangle.cpp:23
void move(int dx, int dy)
Definition: Rectangle.cpp:44