-
Notifications
You must be signed in to change notification settings - Fork 0
/
PointD.cs
59 lines (50 loc) · 1.14 KB
/
PointD.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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Segy_Coord
{
internal class PointD
{
private double _x;
private double _y;
public PointD()
{
_x = 0; _y = 0;
}
public PointD(double x, double y)
{
_x = x;
_y = y;
}
public double X
{
get { return _x; }
set { _x = value; }
}
public double Y
{
get { return _y; }
set { _y = value; }
}
public static PointD SubstractP2FromP1(PointD point1, PointD point2)
{
PointD result = new PointD(point1._x, point1._y);
result._x -= point2._x;
result._y -= point2._y;
return result;
}
public void ShiftCoordinates(double dx, double dy)
{
_x += dx;
_y += dy;
}
public override string ToString()
{
return this._x + "\t" + this._y;
}
}
}