G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 10th, 2020 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private double addLatitude(double base, double offset) {
  2.         double newLatitude = base + offset;
  3.         if (newLatitude <= LATITUDE_BOUND) {
  4.             return newLatitude;
  5.         } else {
  6.             return -(crossBound(newLatitude, LATITUDE_BOUND));
  7.         }
  8.     }
  9.  
  10.     private double subtractLatitude(double base, double offset) {
  11.         double newLatitude = base - offset;
  12.         if (newLatitude >= -LATITUDE_BOUND) {
  13.             return newLatitude;
  14.         } else {
  15.             return crossBound(newLatitude, LATITUDE_BOUND);
  16.         }
  17.     }
  18.  
  19.     private double addLongitude(double base, double offset) {
  20.         double newLongitude = base + offset;
  21.         if (newLongitude <= LONGITUDE_BOUND) {
  22.             return newLongitude;
  23.         } else {
  24.             return crossBound(newLongitude, LONGITUDE_BOUND);
  25.         }
  26.     }
  27.  
  28.     private double subtractLongitude(double base, double offset) {
  29.         double newLongitude = base - offset;
  30.         if (newLongitude >= -LONGITUDE_BOUND) {
  31.             return newLongitude;
  32.         } else {
  33.             return -(crossBound(newLongitude, LONGITUDE_BOUND));
  34.         }
  35.     }
  36.  
  37.     private double crossBound(double newValue, double bound) {
  38.         return bound - (Math.abs(newValue) - bound);
  39.     }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top