NETGeographicLib 1.52
Loading...
Searching...
No Matches
PolarStereographic.h
Go to the documentation of this file.
1#pragma once
2/**
3 * \file NETGeographicLib/PolarStereographic.h
4 * \brief Header for NETGeographicLib::PolarStereographic class
5 *
6 * NETGeographicLib is copyright (c) Scott Heiman (2013)
7 * GeographicLib is Copyright (c) Charles Karney (2010-2012)
8 * <charles@karney.com> and licensed under the MIT/X11 License.
9 * For more information, see
10 * https://geographiclib.sourceforge.io/
11 **********************************************************************/
12
13namespace NETGeographicLib
14{
15 /*!
16 \brief .NET wrapper for GeographicLib::PolarStereographic.
17
18 This class allows .NET applications to access GeographicLib::PolarStereographic.
19 */
20 /**
21 * \brief .NET wrapper for GeographicLib::PolarStereographic.
22 *
23 * This class allows .NET applications to access GeographicLib::PolarStereographic.
24 *
25 * Implementation taken from the report,
26 * - J. P. Snyder,
27 * <a href="http://pubs.er.usgs.gov/usgspubs/pp/pp1395"> Map Projections: A
28 * Working Manual</a>, USGS Professional Paper 1395 (1987),
29 * pp. 160--163.
30 *
31 * This is a straightforward implementation of the equations in Snyder except
32 * that Newton's method is used to invert the projection.
33 *
34 * C# Example:
35 * \include example-PolarStereographic.cs
36 * Managed C++ Example:
37 * \include example-PolarStereographic.cpp
38 * Visual Basic Example:
39 * \include example-PolarStereographic.vb
40 *
41 * <B>INTERFACE DIFFERENCES:</B><BR>
42 * A default constructor is provided that assumes WGS84 parameters and
43 * a UPS scale factor.
44 *
45 * The EquatorialRadius, Flattening, and CentralScale functions are
46 * implemented as properties.
47 **********************************************************************/
48 public ref class PolarStereographic
49 {
50 private:
51 // pointer to the unmanaged GeographicLib::PolarStereographic
52 GeographicLib::PolarStereographic* m_pPolarStereographic;
53
54 // the finalizer frees the unmanaged memory when the object is destroyed.
55 !PolarStereographic(void);
56 public:
57
58 /**
59 * Constructor for a ellipsoid with
60 *
61 * @param[in] a equatorial radius (meters).
62 * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere.
63 * Negative \e f gives a prolate ellipsoid.
64 * @param[in] k0 central scale factor.
65 * @exception GeographicErr if \e a, (1 &minus; \e f ) \e a, or \e k0 is
66 * not positive.
67 **********************************************************************/
68 PolarStereographic(double a, double f, double k0);
69
70 /**
71 * An instantiation of PolarStereographic with the WGS84 ellipsoid
72 * and the UPS scale factor.
73 **********************************************************************/
75
76 /**
77 * The destructor calls the finalizer.
78 **********************************************************************/
80 { this->!PolarStereographic(); }
81
82 /**
83 * Set the scale for the projection.
84 *
85 * @param[in] lat (degrees) assuming \e northp = true.
86 * @param[in] k scale at latitude \e lat
87 * @exception GeographicErr \e k is not positive.
88 * @exception GeographicErr if \e lat is not in (&minus;90&deg;,
89 * 90&deg;] or this object was created with the default constructor.
90 **********************************************************************/
91 void SetScale(double lat, double k);
92
93 /**
94 * Forward projection, from geographic to polar stereographic.
95 *
96 * @param[in] northp the pole which is the center of projection (true means
97 * north, false means south).
98 * @param[in] lat latitude of point (degrees).
99 * @param[in] lon longitude of point (degrees).
100 * @param[out] x easting of point (meters).
101 * @param[out] y northing of point (meters).
102 * @param[out] gamma meridian convergence at point (degrees).
103 * @param[out] k scale of projection at point.
104 *
105 * No false easting or northing is added. \e lat should be in the range
106 * (&minus;90&deg;, 90&deg;] for \e northp = true and in the range
107 * [&minus;90&deg;, 90&deg;) for \e northp = false.
108 **********************************************************************/
109 void Forward(bool northp, double lat, double lon,
110 [System::Runtime::InteropServices::Out] double% x,
111 [System::Runtime::InteropServices::Out] double% y,
112 [System::Runtime::InteropServices::Out] double% gamma,
113 [System::Runtime::InteropServices::Out] double% k);
114
115 /**
116 * Reverse projection, from polar stereographic to geographic.
117 *
118 * @param[in] northp the pole which is the center of projection (true means
119 * north, false means south).
120 * @param[in] x easting of point (meters).
121 * @param[in] y northing of point (meters).
122 * @param[out] lat latitude of point (degrees).
123 * @param[out] lon longitude of point (degrees).
124 * @param[out] gamma meridian convergence at point (degrees).
125 * @param[out] k scale of projection at point.
126 *
127 * No false easting or northing is added. The value of \e lon returned is
128 * in the range [&minus;180&deg;, 180&deg;).
129 **********************************************************************/
130 void Reverse(bool northp, double x, double y,
131 [System::Runtime::InteropServices::Out] double% lat,
132 [System::Runtime::InteropServices::Out] double% lon,
133 [System::Runtime::InteropServices::Out] double% gamma,
134 [System::Runtime::InteropServices::Out] double% k);
135
136 /**
137 * PolarStereographic::Forward without returning the convergence and scale.
138 **********************************************************************/
139 void Forward(bool northp, double lat, double lon,
140 [System::Runtime::InteropServices::Out] double% x,
141 [System::Runtime::InteropServices::Out] double% y);
142
143 /**
144 * PolarStereographic::Reverse without returning the convergence and scale.
145 **********************************************************************/
146 void Reverse(bool northp, double x, double y,
147 [System::Runtime::InteropServices::Out] double% lat,
148 [System::Runtime::InteropServices::Out] double% lon);
149
150 /** \name Inspector functions
151 **********************************************************************/
152 ///@{
153 /**
154 * @return \e a the equatorial radius of the ellipsoid (meters). This is
155 * the value used in the constructor.
156 **********************************************************************/
157 property double EquatorialRadius { double get(); }
158
159 /**
160 * @return \e f the flattening of the ellipsoid. This is the value used in
161 * the constructor.
162 **********************************************************************/
163 property double Flattening { double get(); }
164
165 /**
166 * The central scale for the projection. This is the value of \e k0 used
167 * in the constructor and is the scale at the pole unless overridden by
168 * PolarStereographic::SetScale.
169 **********************************************************************/
170 property double CentralScale { double get(); }
171 ///@}
172 };
173} //namespace NETGeographicLib
.NET wrapper for GeographicLib::PolarStereographic.
void Forward(bool northp, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
void Forward(bool northp, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y)
void Reverse(bool northp, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
void SetScale(double lat, double k)
PolarStereographic(double a, double f, double k0)