summaryrefslogtreecommitdiff
path: root/boost/geometry/strategies/geographic/area.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/geometry/strategies/geographic/area.hpp
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-4fadd968fa12130524c8380f33fcfe25d4de79e5.tar.gz
boost-4fadd968fa12130524c8380f33fcfe25d4de79e5.tar.bz2
boost-4fadd968fa12130524c8380f33fcfe25d4de79e5.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/strategies/geographic/area.hpp')
-rw-r--r--boost/geometry/strategies/geographic/area.hpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/boost/geometry/strategies/geographic/area.hpp b/boost/geometry/strategies/geographic/area.hpp
index e1d3b09b5a..44dc2e6945 100644
--- a/boost/geometry/strategies/geographic/area.hpp
+++ b/boost/geometry/strategies/geographic/area.hpp
@@ -83,7 +83,7 @@ protected :
CT const m_e2; // squared eccentricity
CT const m_ep2; // squared second eccentricity
CT const m_ep; // second eccentricity
- CT const m_c2; // authalic radius
+ CT const m_c2; // squared authalic radius
inline spheroid_constants(Spheroid const& spheroid)
: m_spheroid(spheroid)
@@ -92,12 +92,27 @@ protected :
* (CT(2.0) - CT(formula::flattening<CT>(spheroid))))
, m_ep2(m_e2 / (CT(1.0) - m_e2))
, m_ep(math::sqrt(m_ep2))
- , m_c2((m_a2 / CT(2.0)) +
- ((math::sqr(get_radius<2>(spheroid)) * boost::math::atanh(math::sqrt(m_e2)))
- / (CT(2.0) * math::sqrt(m_e2))))
+ , m_c2(authalic_radius(spheroid, m_a2, m_e2))
{}
};
+ static inline CT authalic_radius(Spheroid const& sph, CT const& a2, CT const& e2)
+ {
+ CT const c0 = 0;
+
+ if (math::equals(e2, c0))
+ {
+ return a2;
+ }
+
+ CT const sqrt_e2 = math::sqrt(e2);
+ CT const c2 = 2;
+
+ return (a2 / c2) +
+ ((math::sqr(get_radius<2>(sph)) * boost::math::atanh(sqrt_e2))
+ / (c2 * sqrt_e2));
+ }
+
struct area_sums
{
CT m_excess_sum;