52 : lam0_(params.lam0_), prime_meridian_offset_(params.prime_meridian_offset_)
67 if (dir == direction::FORWARD)
68 return forward(coord);
70 return inverse(coord);
84 CUPROJ_HOST_DEVICE Coordinate forward(Coordinate
const& coord)
const
87 T t = (coord.y < 0 ? -coord.y : coord.y) - M_PI_2;
91 Coordinate xy = coord;
94 auto half_pi =
static_cast<T
>(M_PI_2);
95 xy.y = std::clamp(xy.y, -half_pi, half_pi);
98 xy.x = (xy.x - prime_meridian_offset_) - lam0_;
101 xy.x = detail::wrap_to_pi(xy.x);
115 CUPROJ_HOST_DEVICE Coordinate inverse(Coordinate
const& coord)
const
117 Coordinate xy = coord;
120 xy.x += prime_meridian_offset_ + lam0_;
123 xy.x = detail::wrap_to_pi(xy.x);
129 T prime_meridian_offset_{};