-
Notifications
You must be signed in to change notification settings - Fork 0
/
RectangleD.cs
122 lines (106 loc) · 2.17 KB
/
RectangleD.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.Drawing;
namespace Fractals
{
public struct RectangleD
{
double x;
double y;
double width;
double height;
public double X {
get {
return x;
}
}
public double Y {
get {
return y;
}
}
public double Width {
get {
return width;
}
}
public double Height {
get {
return height;
}
}
public double Size {
get {
return width;
}
}
public RectangleD(double x, double y, double width, double height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public RectangleD LeftTopQuater {
get {
return new RectangleD(X,
Y,
Width / 2,
Height / 2);
}
}
public RectangleD RightTopQuater {
get {
return new RectangleD(X + Width / 2,
Y,
Width / 2,
Height / 2);
}
}
public RectangleD LeftBottomQuater {
get {
return new RectangleD(X,
Y + Height / 2,
Width / 2,
Height / 2);
}
}
public RectangleD RightBottomQuater {
get {
return new RectangleD(X + Width / 2,
Y + Height / 2,
Width / 2,
Height / 2);
}
}
public PointF LeftTopCornerF {
get {
return new PointF((float)X,
(float)Y);
}
}
public PointF RightTopCornerF {
get {
return new PointF((float)(X + Width),
(float)Y);
}
}
public PointF LeftBottomCornerF {
get {
return new PointF((float)X,
(float)(Y + Height));
}
}
public PointF RightBottomCornerF {
get {
return new PointF((float)(X + Width),
(float)(Y + Height));
}
}
public PointF CentreF {
get {
return new PointF((float)(X + Width / 2),
(float)(Y + Height / 2));
}
}
}
}