52 #ifndef __PCL_ZenithalProjections_h
53 #define __PCL_ZenithalProjections_h
120 double rTheta = GetRTheta( pN );
121 double sinTheta, cosTheta;
122 SinCos(
Rad( pN.x ), sinTheta, cosTheta );
123 pW.x = rTheta * sinTheta;
124 pW.y = -rTheta * cosTheta;
134 pN.y = GetTheta(
Sqrt( pW.x*pW.x + pW.y*pW.y ) );
138 virtual double GetRTheta(
const DPoint& np )
const = 0;
139 virtual double GetTheta(
double rTheta )
const = 0;
185 return "ZenithalEqualArea";
193 return "Zenithal Equal Area";
199 bool CheckBrokenLine(
const DPoint& cp1,
const DPoint& cp2 )
const noexcept
override
201 DPoint np1 = m_sph.CelestialToNative( cp1 );
202 DPoint np2 = m_sph.CelestialToNative( cp2 );
203 return Min(
Mod(
Abs( np1.
x - np2.
x - 360 ), 360.0 ),
204 Mod(
Abs( np1.
x - np2.
x + 360 ), 360.0 ) ) < 180*
Sin(
Rad( 45 + (np1.
y + np2.
y)/2/2 ) );
209 double GetRTheta(
const DPoint& np )
const override
211 return 2 *
Deg(
Sin(
Rad( (90 - np.y)/2 ) ) );
214 double GetTheta(
double rTheta )
const override
263 return "Stereographic";
271 return "Stereographic";
277 bool CheckBrokenLine(
const DPoint& cp1,
const DPoint& cp2)
const noexcept
override
284 double GetRTheta(
const DPoint& np )
const override
286 return 2 *
Deg(
Tan(
Rad( (90 - np.y)/2 ) ) );
289 double GetTheta(
double rTheta )
const override
64-bit floating-point point in the R^2 space.
A generic point in the two-dimensional space.
component x
Abscissa (horizontal, or X-axis coordinate).
component y
Ordinate (vertical, or Y-axis coordinate).
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Base class of all projection systems.
Stereographic projection system.
IsoString Name() const override
IsoString Identifier() const override
IsoString ProjCode() const override
StereographicProjection(const StereographicProjection &)=default
ProjectionBase * Clone() const override
StereographicProjection()=default
Zenithal equal-area projection system.
ProjectionBase * Clone() const override
ZenithalEqualAreaProjection()=default
IsoString ProjCode() const override
IsoString Name() const override
ZenithalEqualAreaProjection(const ZenithalEqualAreaProjection &)=default
IsoString Identifier() const override
Base class of zenithal projection systems.
virtual IsoString Name() const override=0
bool Project(DPoint &pW, const DPoint &pN) const noexcept override
virtual IsoString Identifier() const override=0
ZenithalProjectionBase(const ZenithalProjectionBase &)=default
bool Unproject(DPoint &pN, const DPoint &pW) const noexcept override
virtual IsoString ProjCode() const override=0
virtual ProjectionBase * Clone() const override=0
Complex< T > Sqrt(const Complex< T > &c) noexcept
T Abs(const Complex< T > &c) noexcept
Complex< T > Sin(const Complex< T > &c) noexcept
Complex< T > Tan(const Complex< T > &c) noexcept
void SinCos(T x, T &sx, T &cx) noexcept
constexpr T ArcTan(T x) noexcept
constexpr T ArcSin(T x) noexcept
constexpr T Rad(T x) noexcept
constexpr T Mod(T x, T y) noexcept
constexpr T Deg(T x) noexcept
constexpr const T & Min(const T &a, const T &b) noexcept