示例#1
0
/**
 * Determines the difference in solar time between two longitudes at the same
 * clock time (expressed in the same time zone), that is, at the same point in
 * time
 *
 * For a longitude east of the other longitude, the solar time is later, thus,
 * the returned value is positive.
 *
 * @param other another longitude
 * @return the difference in solar time, in seconds
 * @see clockTimeOffsetTo
 */
double Longitude::solarTimeOffsetTo (const Longitude &other)
{
	double dLon=normalized ().getValue ()-other.normalized ().getValue ();

	// 360° -- 1 day (86400 s)
	return dLon/360*86400;
}
static std::string latlon(const Latitude latitude, const Longitude longitude) {
	if( latitude.is_valid() && longitude.is_valid() ) {
		return latlon_abs_normalized(latitude.normalized(), "SN") + " " + latlon_abs_normalized(longitude.normalized(), "WE");
	} else if( latitude.is_not_available() && longitude.is_not_available() ) {
		return "not available";
	} else {
		return "invalid";
	}
}