Skip to content
Snippets Groups Projects
Commit f8a6a2f5 authored by Lawrence Chung's avatar Lawrence Chung
Browse files

latlng from dist

parent 0788de7f
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package search;
import java.util.ArrayList;
import data.Record;
import java.lang.Math;
public class BasicSearchResult {
private ArrayList<Record> results;
......@@ -10,13 +11,18 @@ public class BasicSearchResult {
private BST<Integer, Integer> histogram;
private Integer sum;
public static void main(String[] args) {
//Graph g = new Graph();
}
public BasicSearchResult(ArrayList<Record> results, double time) {
this.results = results;
this.time = time;
}
public Iterable<Record> results() {
return (Iterable<Record>) results;
return (Iterable<Record>) results;
}
public int n() {
......@@ -41,4 +47,13 @@ public class BasicSearchResult {
}
return this.sum;
}
private double lngRange(double dist, double lat){
return dist/(Math.cos(lat)*222);
}
private double latRange(double dist){
return (dist/111)/2;
}
}
......@@ -8,13 +8,7 @@ public class Graph {
public static void main(String[] args) {
Graph g = new Graph(5);
g.addEdge(4, 3);
g.addEdge(2, 3);
g.addEdge(1, 2);
g.addEdge(0, 2);
for(int i = 0; i < 5; i++)
System.out.println(g.adj(i));
}
public Graph(int V){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment