public boolean isValid(){
  return (Math.abs(lat.lo()) <= S2.M_PI_2 && Math.abs(lat.hi()) <= S2.M_PI_2 && lng.isValid() && lat.isEmpty() == lng.isEmpty());
}

public boolean isValid ( ) { return ( Math . abs ( lat . lo ( ) ) <= S2 . M_PI_2 && Math . abs ( lat . hi ( ) ) <= S2 . M_PI_2 && lng . isValid ( ) && lat . isEmpty ( ) == lng . isEmpty ( ) ) ; }
return true if the rectangle is valid , which essentially just means that the latitude bounds do not exceed pi / 2 in absolute value and the longitude bounds do not exceed pi in absolute value .
