/[projects]/dao/FuldDaekningWorker/src/com/jwetherell/algorithms/data_structures/KdTree.java
ViewVC logotype

Diff of /dao/FuldDaekningWorker/src/com/jwetherell/algorithms/data_structures/KdTree.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2707 by torben, Sun Sep 27 13:21:45 2015 UTC revision 2708 by torben, Sun Sep 27 18:20:41 2015 UTC
# Line 3  package com.jwetherell.algorithms.data_s Line 3  package com.jwetherell.algorithms.data_s
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;
# Line 577  public class KdTree<T extends KdTree.XYZ Line 581  public class KdTree<T extends KdTree.XYZ
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));

Legend:
Removed from v.2707  
changed lines
  Added in v.2708

  ViewVC Help
Powered by ViewVC 1.1.20