-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (27 loc) · 1.16 KB
/
Program.cs
File metadata and controls
30 lines (27 loc) · 1.16 KB
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
using System.Diagnostics;
using Task_6;
Point centre = new Point(49.8434957584673, 24.00781313076388);
double radius = 0.6;
void Main(string[] args)
{
centre = new Point(Convert.ToDouble(args[0]), Convert.ToDouble(args[1]));
radius = Convert.ToDouble(args[2]);
}
Console.OutputEncoding = System.Text.Encoding.UTF8;
var fileReader = new FileReader(new Dictionary<Point, string>(), @"D:\C#\Task_6\ukraine_poi.csv");
fileReader.ReadFile();
var pointMin = fileReader.FindMinCoords();
var pointMax = fileReader.FindMaxCoords();
var root = new Node(new Rectangle(pointMin, pointMax, fileReader.GetData()), null, null);
var kdTree = new KdTreeBuilder(root);
var kd = kdTree.BuildKd(root, fileReader.GetData().Count, 2);
var rect = new Rectangle(pointMin, pointMax, fileReader.GetData());
var res = rect.DescribeCircle(centre, radius, 45);
var res2 = rect.DescribeCircle(centre, radius, 225);
Rectangle describeCircle = new Rectangle(res, res2, new Dictionary<Point, string>());
Console.WriteLine(rect.DoRectsOverlap(describeCircle));
KdTreeSearcher toSearch = new KdTreeSearcher(kd, describeCircle);
var sw = new Stopwatch();
toSearch.Search(centre, radius);
Console.WriteLine();