boost::geometry::math
typename T
T T boost::geometry::math::abs (T const &value) abs T const & value

Short utility to workaround gcc/clang problem that abs is converting to integer and that older versions of MSVC does not support abs of long long...

typename DegreeOrRadian
typename T
T T boost::geometry::math::as_radian (T const &value) as_radian T const & value
typename T
T T boost::geometry::math::d2r () d2r
typename T1
typename T2
bool bool boost::geometry::math::equals (T1 const &a, T2 const &b) equals T1 const & a T2 const & b

returns true if both arguments are equal.

a

first argument

b

second argument

true if a == b

If both a and b are of an integral type, comparison is done by ==. If one of the types is floating point, comparison is done by abs and comparing with epsilon. If one of the types is non-fundamental, it might be a high-precision number and comparison is done using the == operator of that class.

typename T1
typename T2
bool bool boost::geometry::math::equals_with_epsilon (T1 const &a, T2 const &b) equals_with_epsilon T1 const & a T2 const & b
typename DegreeOrRadian
typename T
T T boost::geometry::math::from_radian (T const &value) from_radian T const & value
typename T
T T boost::geometry::math::half_pi () half_pi
typename T
T T boost::geometry::math::hav (T const &theta) hav T const & theta

Calculates the haversine of an angle.

See http://en.wikipedia.org/wiki/Haversine_formula haversin(alpha) = sin2(alpha/2)

typename T1
typename T2
bool bool boost::geometry::math::larger (T1 const &a, T2 const &b) larger T1 const & a T2 const & b
typename T1
typename T2
bool bool boost::geometry::math::larger_or_equals (T1 const &a, T2 const &b) larger_or_equals T1 const & a T2 const & b
typename Units
typename CoordinateType
CoordinateType CoordinateType boost::geometry::math::longitude_distance_signed (CoordinateType const &longitude1, CoordinateType const &longitude2) longitude_distance_signed CoordinateType const & longitude1 CoordinateType const & longitude2

Short utility to calculate difference between two longitudes normalized in range (-180, 180].

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude1

Longitude 1

longitude2

Longitude 2

typename Units
typename CoordinateType
CoordinateType CoordinateType boost::geometry::math::longitude_distance_unsigned (CoordinateType const &longitude1, CoordinateType const &longitude2) longitude_distance_unsigned CoordinateType const & longitude1 CoordinateType const & longitude2

Short utility to calculate difference between two longitudes normalized in range [0, 360).

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude1

Longitude 1

longitude2

Longitude 2

typename T
detail::modulo< T >::return_type detail::modulo<T>::return_type boost::geometry::math::mod (T const &value1, T const &value2) mod T const & value1 T const & value2

Short utility to return the modulo of two values.

value1

First value

value2

Second value

The result of the modulo operation on the (ordered) pair (value1, value2)

typename Units
typename CoordinateType
void void boost::geometry::math::normalize_longitude (CoordinateType &longitude) normalize_longitude CoordinateType & longitude

Short utility to normalize the longitude on a spheroid. Note that in general both coordinates should be normalized at once. This utility is suitable e.g. for normalization of the difference of longitudes.

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude

Longitude

typename Units
typename CoordinateType
void void boost::geometry::math::normalize_spheroidal_box_coordinates (CoordinateType &longitude1, CoordinateType &latitude1, CoordinateType &longitude2, CoordinateType &latitude2) normalize_spheroidal_box_coordinates CoordinateType & longitude1 CoordinateType & latitude1 CoordinateType & longitude2 CoordinateType & latitude2

Short utility to normalize the coordinates of a box on a spheroid.

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude1

Minimum longitude of the box

latitude1

Minimum latitude of the box

longitude2

Maximum longitude of the box

latitude2

Maximum latitude of the box

typename Units
typename CoordinateType
void void boost::geometry::math::normalize_spheroidal_box_coordinates (CoordinateType &longitude1, CoordinateType &latitude1, CoordinateType &longitude2, CoordinateType &latitude2, bool band) normalize_spheroidal_box_coordinates CoordinateType & longitude1 CoordinateType & latitude1 CoordinateType & longitude2 CoordinateType & latitude2 bool band

Short utility to normalize the coordinates of a box on a spheroid.

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude1

Minimum longitude of the box

latitude1

Minimum latitude of the box

longitude2

Maximum longitude of the box

latitude2

Maximum latitude of the box

band

Indicates whether the box should be treated as a band or not and avoid the computation done in the other version of the function

typename Units
typename CoordinateType
void void boost::geometry::math::normalize_spheroidal_coordinates (CoordinateType &longitude, CoordinateType &latitude) normalize_spheroidal_coordinates CoordinateType & longitude CoordinateType & latitude

Short utility to normalize the coordinates on a spheroid.

Units

The units of the coordindate system in the spheroid

CoordinateType

The type of the coordinates

longitude

Longitude

latitude

Latitude

typename T
T T boost::geometry::math::pi () pi
typename T
T T boost::geometry::math::r2d () r2d
typename T
T T boost::geometry::math::relaxed_epsilon (T const &factor) relaxed_epsilon T const & factor
typename Result
typename T
Result Result boost::geometry::math::rounding_cast (T const &v) rounding_cast T const & v

Short utility to cast a value possibly rounding it to the nearest integral value.

If the source T is NOT an integral type and Result is an integral type the value is rounded towards the closest integral value. Otherwise it's casted without rounding.

typename T
T T boost::geometry::math::scaled_epsilon (T const &value) scaled_epsilon T const & value
typename T
int int boost::geometry::math::sign (T const &value) sign T const & value

Short utility to calculate the sign of a number: -1 (negative), 0 (zero), 1 (positive)

typename T1
typename T2
bool bool boost::geometry::math::smaller (T1 const &a, T2 const &b) smaller T1 const & a T2 const & b
typename T1
typename T2
bool bool boost::geometry::math::smaller_or_equals (T1 const &a, T2 const &b) smaller_or_equals T1 const & a T2 const & b
typename T
T T boost::geometry::math::sqr (T const &value) sqr T const & value

Short utility to return the square.

value

Value to calculate the square from

The squared value

typename T
detail::square_root< T >::return_type detail::square_root<T>::return_type boost::geometry::math::sqrt (T const &value) sqrt T const & value

Short utility to return the square root.

value

Value to calculate the square root from

The square root value

typename T
T T boost::geometry::math::two_pi () two_pi