-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBigTenData.java
More file actions
75 lines (71 loc) · 5.43 KB
/
BigTenData.java
File metadata and controls
75 lines (71 loc) · 5.43 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
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
/**
* A class of static factory methods for Big Team Conference data.
*
* @author gcschmit
* @version 02jun2020
*/
public class BigTenData
{
private static final City[] cities = new City[] {
new City(42.0450722, -87.6876969, "Northwestern", "Evanston, IL"),
new City(39.165325, -86.5263857, "Indiana", "Bloomington, IN"),
new City(38.9896967, -76.93776, "Maryland", "College Park, MD"),
new City(42.2808256, -83.7430378, "Michigan", "Ann Arbor, MI"),
new City(42.7369792, -84.4838654, "Michigan State", "East Lansing, MI"),
new City(39.9611755, -82.9987942, "Ohio State", "Columbus, OH"),
new City(40.7933949, -77.8600012, "Penn State", "State College, PA"),
new City(40.4862157, -74.4518188, "Rutgers", "New Brunswick, NJ"),
new City(40.1164204, -88.2433829, "Illinois", "Champaign, IL"),
new City(41.6611277, -91.5301683, "Iowa", "Iowa City, IA"),
new City(44.977753, -93.2650108, "Minnesota", "Minneapolis, MN"),
new City(40.813616, -96.7025955, "Nebraska", "Lincoln, NE"),
new City(40.4258686, -86.9080655, "Purdue", "West Lafayette, IN"),
new City(43.0730517, -89.4012302, "Wisconsin", "Madison, WI")
};
private static final double[][] distanceMatrix = new double[][]{
{ 0, 252.140545751, 715.964171443, 259.04894852900000, 238.303856323, 376.294821148, 585.074234406, 800.62410608, 155.288690723, 228.977077613, 406.04109366, 529.547279104, 142.764336847, 144.335162735 },
{ 252.140545751, 0, 624.085769899, 315.926764385, 306.251396544, 225.353241941, 547.012153801, 747.953593265, 154.213097522, 395.246015277, 634.311051075, 658.387313212, 112.79996311400000, 372.604498779 },
{ 715.964171443, 624.085769899, 0, 520.920785511, 586.542534079, 399.956007457, 196.75588440800000, 189.986047363, 695.553998206, 903.715147319, 1105.1387706790000, 1204.28534881, 640.269377594, 843.432839754 },
{ 259.04894852900000, 315.926764385, 520.920785511, 0, 65.654681231, 188.807306576, 390.51489648300000, 606.064768157, 343.027239179, 445.923791295, 648.261451396, 746.493992786, 257.084794798, 386.5548991 },
{ 238.303856323, 306.251396544, 586.542534079, 65.654681231, 0, 254.030756333, 455.73834624, 671.288217914, 323.931265607, 426.827817723, 629.165477824, 727.398019214, 249.198354066, 367.458925528 },
{ 376.294821148, 225.353241941, 399.956007457, 188.807306576, 254.030756333, 0, 322.873692165, 523.815753, 296.736342421, 537.769881547, 762.9621883990000, 813.888512817, 241.451721809, 501.256257474 },
{ 585.074234406, 547.012153801, 196.75588440800000, 390.51489648300000, 455.73834624, 322.873692165, 0, 229.163488913, 617.617297789, 772.50085462, 973.925099351, 1073.071677482, 535.345291905, 712.219168426 },
{ 800.62410608, 747.953593265, 189.986047363, 606.064768157, 671.288217914, 523.815753, 229.163488913, 0, 818.564329592, 989.402208219, 1190.82645295, 1289.973031081, 763.27970898, 929.119900654 },
{ 155.288690723, 154.213097522, 695.553998206, 343.027239179, 323.931265607, 296.736342421, 617.617297789, 818.564329592, 0, 243.960817907, 512.470139911, 517.141607089, 91.103551907, 250.764208986 },
{ 228.977077613, 395.246015277, 903.715147319, 445.923791295, 426.827817723, 537.769881547, 772.50085462, 989.402208219, 243.960817907, 0, 302.575987079, 303.360778652, 324.422148697, 174.84758569000000 },
{ 406.04109366, 634.311051075, 1105.1387706790000, 648.261451396, 629.165477824, 762.9621883990000, 973.925099351, 1190.82645295, 512.470139911, 302.575987079, 0, 433.844960426, 530.811769089, 268.485709906 },
{ 529.547279104, 658.387313212, 1204.28534881, 746.493992786, 727.398019214, 813.888512817, 1073.071677482, 1289.973031081, 517.141607089, 303.360778652, 433.844960426, 0, 625.103575597, 487.795497501 },
{ 142.764336847, 112.79996311400000, 640.269377594, 257.084794798, 249.198354066, 241.451721809, 535.345291905, 763.27970898, 91.103551907, 324.422148697, 530.811769089, 625.103575597, 0, 267.907213505 },
{ 144.335162735, 372.604498779, 843.432839754, 386.5548991, 367.458925528, 501.256257474, 712.219168426, 929.119900654, 250.764208986, 174.84758569000000, 268.485709906, 487.795497501, 267.907213505, 0 },
};
/**
* Returns an array of references to City objects in the Big Ten Conference
*
* @return an array of references to City objects in the Big Ten Conference
*/
public static City[] getCities()
{
/*
* obtained via Google Maps JavaScript API, Distance Matrix Service
*/
return cities;
}
/**
* Returns a 2D array of distances (in miles) between cities in the Big Ten Conference.
* The rows and columns in this 2D array correspond to the cities returned by the
* getBigTen method.
*
* For example, to get the distance between Michigan (index 3) and Ohio State (index 5),
* find the value in the 2D array at row 3 and column 5, which is 189 miles.
* Note that the almost same value is at row 5 and column 3.
*
* @return a 2D array of distances between cities in the Big Ten Conference
*/
public static double[][] getDistanceMatrix()
{
/*
* obtained via Google Maps JavaScript API, Distance Matrix Service
*/
return distanceMatrix;
}
}