Here you can find the source of clamp_latitude(double lat)
Parameter | Description |
---|---|
lat | the latitude |
public static double clamp_latitude(double lat)
//package com.java2s; public class Main { /** //from w w w . j a v a2s .c om * Ensure value is in the valid range for latitude ([-pi, pi]) * @param lat the latitude * @return normalized latitude */ public static double clamp_latitude(double lat) { if (lat > StrictMath.PI) { return StrictMath.PI; } else if (lat < -StrictMath.PI) { return -StrictMath.PI; } else { return lat; } } }