@@ -0,0 +1,1867 @@
+package com.util;%0A%0Aimport java.util.*;%0A%0A%0A/**%0A * @author Chris Park @ Infinetix Corp%0A * Date: 4-21-21%0A * Description: Singletone class containing useful utility functions for %0A * Minds-i Dashboard specific functionality and calculations.%0A */%0Apublic class UtilHelper %7B%0A%09private static UtilHelper utilHelperInstance = null;%0A%09%0A%09private static final double EARTH_RADIUS = 6371.00;%0A%09private static final double FEET_PER_KM = 3280.84;%0A%09%0A%09/**%0A%09 * Constructor (Private, accessed by getInstance%0A%09 */%0A%09private UtilHelper() %7B%0A%09%09%0A%09%7D%0A%09%0A%09/**%0A%09 * Returns the singleton instance of this class to be used system wide.%0A%09 * @return The UtilHelper instance.%0A%09 */%0A%09public static UtilHelper getInstance() %7B%0A%09%09if(utilHelperInstance == null) %7B%0A%09%09%09utilHelperInstance = new UtilHelper();%0A%09%09%7D%0A%09%09%0A%09%09return utilHelperInstance;%0A%09%7D%0A%09%0A%09/**%0A%09 * Computes the distance in km between to points on the surface of a sphere.%0A%09 * @param lat1 - First latitude coordinate%0A%09 * @param lon1 - First longitude coordinate%0A%09 * @param lat2 - Second latitude coordinate%0A%09 * @param lon2 - Second longitude coordinate%0A%09 * @return - Distance between coordinates in km%0A%09 */%0A%09public double haversine(double lat1, double lon1,%0A%09%09%09%09%09%09%09double lat2, double lon2) %7B%0A%09%09//Calculate distance between Lats and Longs%0A%09%09double distLat = Math.toRadians(lat2 - lat1);%0A%09%09double distLon = Math.toRadians(lon2 - lon1);%0A%09%09%0A%09%09//Convert to Radians%0A%09%09lat1 = Math.toRadians(lat1);%0A%09%09lat2 = Math.toRadians(lat2);%0A%09%09%0A%09%09//Use Formula%0A%09%09double a = (Math.pow(Math.sin(distLat / 2), 2) + %0A%09%09%09%09   (Math.pow(Math.sin(distLon / 2), 2) * %0A%09%09%09%09    Math.cos(lat1) * %0A%09%09%09%09    Math.cos(lat2)));%0A%09%09double c = (2 * Math.asin(Math.sqrt(a)));%0A%09%09return EARTH_RADIUS * c;%0A%09%7D%0A%09%0A%09/**%0A%09 * Converts kilometer to feet.%0A%09 * @param km - distance in km to convert%0A%09 * @return - distance in feet.%0A%09 */%0A%09public double kmToFeet(double km) %7B%0A%09%09return (km * FEET_PER_KM);%0A%09%7D%0A%7D%0A

Create UtilHelper.java