This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double distance(double lat1, double lon1, double lat2, double lon2) { | |
// Haversine great circle distance approximation, returns meters | |
double theta = lon1 - lon2; | |
double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) | |
+ Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) | |
* Math.cos(deg2rad(theta)); | |
dist = Math.acos(dist); | |
dist = rad2deg(dist); | |
dist = dist * 60; // 60 nautical miles per degree of separation | |
dist = dist * 1852; // 1852 meters per nautical mile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.designpatterns.adapter; | |
public interface AbcAccountsAPI {// This was old API | |
public String getAccountName(); | |
public String getDescription(); | |
public double getDebitAmount(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.designpatterns.template; | |
public class WashineMachineApplication { | |
public static void main(String[] args) { | |
WashineMachineProcess wmProcess = new WashineMachineProcessor(); | |
wmProcess.run(); | |
} | |
} |
OlderNewer