Various utility functions.
|
degrees(x)
Convert angle x from radians to degrees. |
|
|
|
radians(x)
Convert angle x from degrees to radians. |
|
|
|
acos1(x)
Return math.acos(max(-1, min(1, x))) . |
|
|
|
acre2ha(acres)
Convert acres to hectare. |
|
|
|
acre2m2(acres)
Convert acres to square meter. |
|
|
|
asin1(x)
Return math.asin(max(-1, min(1, x))) . |
|
|
|
atand(y_x)
Return atan(y_x) angle in degrees . |
|
|
|
atan2b(y,
x)
Return atan2(y, x) in degrees [0..+360]. |
|
|
|
atan2d(y,
x,
reverse=False)
Return atan2(y, x) in degrees [-180..+180], optionally reversed (for
azi2 ). |
|
|
|
chain2m(chains)
Convert UK chains to meter. |
|
|
|
circle4(earth,
lat)
Get the equatorial or a parallel circle of latitude. |
|
|
|
degrees90(rad)
Convert radians to degrees and wrap [-270..+90]. |
|
|
|
degrees180(rad)
Convert radians to degrees and wrap [-180..+180]. |
|
|
|
degrees360(rad)
Convert radians to degrees and wrap [0..+360). |
|
|
|
|
|
degrees2m(deg,
radius=6371008.77141,
lat=0)
Convert an angle to a distance along the equator or along the
parallel at an other (geodetic) latitude. |
|
|
|
fathom2m(fathoms)
Convert UK fathom to meter. |
|
|
|
ft2m(feet,
usurvey=False)
Convert International or US Survey feet to meter. |
|
|
|
furlong2m(furlongs)
Convert a UK furlong to meter. |
|
|
|
grades(rad)
Convert radians to grades (aka gradians or
gons). |
|
|
|
grades400(rad)
Convert radians to grades (aka gradians or gons)
and wrap [0..+400). |
|
|
|
|
|
|
|
m2degrees(distance,
radius=6371008.77141,
lat=0)
Convert a distance to an angle along the equator or along the
parallel at an other (geodetic) latitude. |
|
|
|
m2ft(meter,
usurvey=False)
Convert meter to International or US Survey feet
(ft ). |
|
|
|
m2km(meter)
Convert meter to kilo meter (km). |
|
|
|
m2NM(meter)
Convert meter to nautical miles (NM). |
|
|
|
m2radians(distance,
radius=6371008.77141,
lat=0)
Convert a distance to an angle along the equator or along the
parallel at an other (geodetic) latitude. |
|
|
|
m2SM(meter)
Convert meter to statute miles (SM). |
|
|
|
m2yard(meter)
Convert meter to UK yards. |
|
|
|
radiansPI(deg)
Convert and wrap degrees to radians [-PI..+PI]. |
|
|
|
radiansPI2(deg)
Convert and wrap degrees to radians [0..+2PI). |
|
|
|
radiansPI_2(deg)
Convert and wrap degrees to radians [-3PI/2..+PI/2]. |
|
|
|
radians2m(rad,
radius=6371008.77141,
lat=0)
Convert an angle to a distance along the equator or along the
parallel at an other (geodetic) latitude. |
|
|
|
sincos2(*rad)
Return the sine and cosine of angle(s). |
|
|
|
sincos2d(*deg)
Return the sine and cosine of angle(s) in
degrees . |
|
|
|
tan_2(rad,
**semi)
Compute the tangent of half angle. |
|
|
|
tanPI_2_2(rad)
Compute the tangent of half angle, 90 degrees rotated. |
|
|
|
unroll180(lon1,
lon2,
wrap=True)
Unroll longitudinal delta and wrap longitude in degrees. |
|
|
|
unrollPI(rad1,
rad2,
wrap=True)
Unroll longitudinal delta and wrap longitude in radians. |
|
|
|
wrap90(deg)
Wrap degrees to [-270..+90]. |
|
|
|
wrap180(deg)
Wrap degrees to [-180..+180]. |
|
|
|
wrap360(deg)
Wrap degrees to [0..+360). |
|
|
|
wrapPI(rad)
Wrap radians to [-PI..+PI]. |
|
|
|
wrapPI2(rad)
Wrap radians to [0..+2PI). |
|
|
|
wrapPI_2(rad)
Wrap radians to [-3PI/2..+PI/2]. |
|
|
|
yard2m(yards)
Convert UK yards to meter. |
|
|