GeographicLib: CircularEngine.hpp Source File (original) (raw)

53 private:

55 enum normalization {

56 FULL = SphericalEngine::FULL,

57 SCHMIDT = SphericalEngine::SCHMIDT,

58 };

59 int _mM;

60 bool _gradp;

61 unsigned _norm;

62 real _a, _r, _u, _t;

63 std::vector _wc, _ws, _wrc, _wrs, _wtc, _wts;

64 real _q, _uq, _uq2;

65

66 Math::real Value(bool gradp, real sl, real cl,

67 real& gradx, real& grady, real& gradz) const;

68

71 real a, real r, real u, real t)

72 : _mM(M)

73 , _gradp(gradp)

74 , _norm(norm)

75 , _a(a)

76 , _r(r)

77 , _u(u)

78 , _t(t)

79 , _wc(std::vector(_mM + 1, 0))

80 , _ws(std::vector(_mM + 1, 0))

81 , _wrc(std::vector(_gradp ? _mM + 1 : 0, 0))

82 , _wrs(std::vector(_gradp ? _mM + 1 : 0, 0))

83 , _wtc(std::vector(_gradp ? _mM + 1 : 0, 0))

84 , _wts(std::vector(_gradp ? _mM + 1 : 0, 0))

85 {

86 _q = _a / _r;

87 _uq = _u * _q;

88 _uq2 = Math::sq(_uq);

89 }

90

91 void SetCoeff(int m, real wc, real ws)

92 { _wc[m] = wc; _ws[m] = ws; }

93

94 void SetCoeff(int m, real wc, real ws,

96 _wc[m] = wc; _ws[m] = ws;

97 if (_gradp) {

98 _wrc[m] = wrc; _wrs[m] = wrs;

99 _wtc[m] = wtc; _wts[m] = wts;

100 }

101 }

102

103 public:

104

105

106

107

108

109

111 : _mM(-1)

112 , _gradp(true)

113 , _u(0)

114 , _t(1)

115 {}

116

117

118

119

120

121

122

123

124

125

126

127

129 real dummy;

130 return Value(false, sinlon, coslon, dummy, dummy, dummy);

131 }

132

133

134

135

136

137

138

140 real sinlon, coslon;

141 Math::sincosd(lon, sinlon, coslon);

142 return (*this)(sinlon, coslon);

143 }

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

163 real& gradx, real& grady, real& gradz) const {

164 return Value(true, sinlon, coslon, gradx, grady, gradz);

165 }

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

182 real& gradx, real& grady, real& gradz) const {

183 real sinlon, coslon;

184 Math::sincosd(lon, sinlon, coslon);

185 return (*this)(sinlon, coslon, gradx, grady, gradz);

186 }

187 };