11using System ;
22using System . Collections . Generic ;
3+ using System . Runtime . CompilerServices ;
34using System . Text ;
45using System . Windows ;
56
@@ -11,5 +12,114 @@ public static MyPoint ToMyPoint(this Point point)
1112 {
1213 return MyPoint . CreateFromPoint ( point ) ;
1314 }
15+
16+ public static bool IsClear ( this Point point )
17+ {
18+ return ( point . X == 0 ) && ( point . Y == 0 ) ;
19+ }
20+ public static Point Clear ( this Point point )
21+ {
22+ return new Point ( 0 , 0 ) ;
23+ }
24+ public static Point Mirror ( this Point point , bool onX = true , bool onY = true )
25+ {
26+ return new Point ( onX ? - point . X : point . X , onY ? - point . Y : point . Y ) ;
27+ }
28+
29+ public static Point Copy ( this Point point )
30+ {
31+ return new Point ( point . X , point . Y ) ;
32+ }
33+
34+
35+ public static Point Addition ( this Point point1 , Point point2 )
36+ {
37+ return new Point ( point1 . X + point2 . X , point1 . Y + point2 . Y ) ;
38+ }
39+ public static Point Addition ( this Point point1 , int number )
40+ {
41+ return new Point ( point1 . X + number , point1 . Y + number ) ;
42+ }
43+ public static Point Addition ( this Point point1 , int x , int y )
44+ {
45+ return new Point ( point1 . X + x , point1 . Y + y ) ;
46+ }
47+ public static Point Addition ( this Point point1 , double number )
48+ {
49+ return new Point ( point1 . X + number , point1 . Y + number ) ;
50+ }
51+ public static Point Addition ( this Point point1 , double x , double y )
52+ {
53+ return new Point ( point1 . X + x , point1 . Y + y ) ;
54+ }
55+
56+
57+
58+ public static Point Subtraction ( this Point point1 , Point point2 )
59+ {
60+ return new Point ( point1 . X - point2 . X , point1 . Y - point2 . Y ) ;
61+ }
62+
63+ public static Point Subtraction ( this Point point1 , int number )
64+ {
65+ return new Point ( point1 . X - number , point1 . Y - number ) ;
66+ }
67+ public static Point Subtraction ( this Point point1 , int x , int y )
68+ {
69+ return new Point ( point1 . X - x , point1 . Y - y ) ;
70+ }
71+
72+ public static Point Subtraction ( this Point point1 , double number )
73+ {
74+ return new Point ( point1 . X - number , point1 . Y - number ) ;
75+ }
76+ public static Point Subtraction ( this Point point1 , double x , double y )
77+ {
78+ return new Point ( point1 . X - x , point1 . Y - y ) ;
79+ }
80+
81+
82+ public static Point Division ( this Point point1 , Point point2 )
83+ {
84+ return new Point ( point1 . X / point1 . X , point1 . Y / point1 . Y ) ;
85+ }
86+ public static Point Division ( this Point point1 , int number )
87+ {
88+ return new Point ( point1 . X / number , point1 . Y / number ) ;
89+ }
90+ public static Point Division ( this Point point1 , int x , int y )
91+ {
92+ return new Point ( point1 . X / x , point1 . Y / y ) ;
93+ }
94+ public static Point Division ( this Point point1 , double number )
95+ {
96+ return new Point ( point1 . X / number , point1 . Y / number ) ;
97+ }
98+ public static Point Division ( this Point point1 , double x , double y )
99+ {
100+ return new Point ( point1 . X / x , point1 . Y / y ) ;
101+ }
102+
103+
104+ public static Point Multiply ( this Point point1 , Point point2 )
105+ {
106+ return new Point ( point1 . X * point2 . X , point1 . Y * point2 . Y ) ;
107+ }
108+ public static Point Multiply ( this Point point1 , int number )
109+ {
110+ return new Point ( point1 . X * number , point1 . Y * number ) ;
111+ }
112+ public static Point Multiply ( this Point point1 , int x , int y )
113+ {
114+ return new Point ( point1 . X * x , point1 . Y * y ) ;
115+ }
116+ public static Point Multiply ( this Point point1 , double number )
117+ {
118+ return new Point ( point1 . X * number , point1 . Y * number ) ;
119+ }
120+ public static Point Multiply ( this Point point1 , double x , double y )
121+ {
122+ return new Point ( point1 . X * x , point1 . Y * y ) ;
123+ }
14124 }
15125}
0 commit comments