Skip to content

Instantly share code, notes, and snippets.

View priyankahdp's full-sized avatar
💭
Everything changes, nothing remains without change

Priyanka Kulathilaka priyankahdp

💭
Everything changes, nothing remains without change
View GitHub Profile
@priyankahdp
priyankahdp / GeoLocations.java
Created May 17, 2022 08:57
Pass Radium and getting nearBy locations by longitudes and latitudes
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
package com.designpatterns.adapter;
public interface AbcAccountsAPI {// This was old API
public String getAccountName();
public String getDescription();
public double getDebitAmount();
package com.designpatterns.template;
public class WashineMachineApplication {
public static void main(String[] args) {
WashineMachineProcess wmProcess = new WashineMachineProcessor();
wmProcess.run();
}
}