3 |
/* |
/* |
4 |
* Borrowed from |
* Borrowed from |
5 |
* https://github.com/phishman3579/java-algorithms-implementation |
* https://github.com/phishman3579/java-algorithms-implementation |
6 |
|
* |
7 |
|
* Only adjustment is |
8 |
|
* public XYZPoint(double latitude, double longitude) { //create point from lat/lng pair |
9 |
|
* |
10 |
*/ |
*/ |
11 |
|
|
12 |
import java.util.ArrayList; |
import java.util.ArrayList; |
581 |
this.z = z; |
this.z = z; |
582 |
} |
} |
583 |
|
|
584 |
public XYZPoint(double latitude, double longitude) { |
public XYZPoint(double latitude, double longitude) { //create point from lat/lng pair |
585 |
this.x = Math.cos(Math.toRadians(latitude)) * Math.cos(Math.toRadians(longitude)); |
this.x = Math.cos(Math.toRadians(latitude)) * Math.cos(Math.toRadians(longitude)); |
586 |
this.y = Math.cos(Math.toRadians(latitude)) * Math.sin(Math.toRadians(longitude)); |
this.y = Math.cos(Math.toRadians(latitude)) * Math.sin(Math.toRadians(longitude)); |
587 |
this.z = Math.sin(Math.toRadians(latitude)); |
this.z = Math.sin(Math.toRadians(latitude)); |