-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLUX.SH.Diff.pas
More file actions
299 lines (224 loc) · 8.08 KB
/
LUX.SH.Diff.pas
File metadata and controls
299 lines (224 loc) · 8.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
unit LUX.SH.Diff;
interface //#################################################################### ■
uses LUX,
LUX.D1.Diff,
LUX.Complex.Diff,
LUX.ALFs.Diff,
LUX.NALFs.Diff,
LUX.FNALFs.Diff;
type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 T Y P E 】
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 R E C O R D 】
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 C L A S S 】
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSPHarmonics
TdSPHarmonics = class
private
protected
_dALFs :TdALFs;
_AngleX :TdDouble;
_AngleY :TdDouble;
///// E V E N T
_OnChange :TDelegates;
///// A C C E S S O R
procedure OnUpALFs( Sender:TObject );
function GetALFs :TdALFs;
procedure SetALFs( const ALFs_:TdALFs );
function GetDegN :Integer;
procedure SetDegN( const DegN_:Integer );
function GetAngleX :TdDouble;
procedure SetAngleX( const AngleX_:TdDouble );
function GetAngleY :TdDouble;
procedure SetAngleY( const AngleY_:TdDouble );
function GetSHs( const N_,M_:Integer ) :TdDoubleC; virtual; abstract;
function GetRSHs( const N_,M_:Integer ) :TdDouble; virtual; abstract;
public
constructor Create( const DegN_:Integer ); overload;
///// P R O P E R T Y
property dALFs :TdALFs read GetALFs write SetALFs ;
property DegN :Integer read GetDegN write SetDegN ;
property AngleX :TdDouble read GetAngleX write SetAngleX;
property AngleY :TdDouble read GetAngleY write SetAngleY;
property SHs[ const N_,M_:Integer ] :TdDoubleC read GetSHs ; default;
property RSHs[ const N_,M_:Integer ] :TdDouble read GetRSHs ;
///// E V E N T
property OnChange :TDelegates read _OnChange;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSPHarmonics<TdNALFs_>
TdSPHarmonics<TdNALFs_:TdNALFs,constructor> = class( TdSPHarmonics )
private
protected
///// A C C E S S O R
function GetSHs( const N_,M_:Integer ) :TdDoubleC; override;
function GetRSHs( const N_,M_:Integer ) :TdDouble; override;
public
constructor Create; overload;
constructor Create( const DegN_:Integer ); overload;
destructor Destroy; override;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdRSPHarmonics<TdFNALFs_>
TdRSPHarmonics<TdFNALFs_:TdFNALFs,constructor> = class( TdSPHarmonics )
private
protected
///// A C C E S S O R
function GetSHs( const N_,M_:Integer ) :TdDoubleC; override;
function GetRSHs( const N_,M_:Integer ) :TdDouble; override;
public
constructor Create; overload;
constructor Create( const DegN_:Integer ); overload;
destructor Destroy; override;
end;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 R O U T I N E 】
implementation //############################################################### ■
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 R E C O R D 】
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 C L A S S 】
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSPHarmonics
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
//////////////////////////////////////////////////////////////// A C C E S S O R
procedure TdSPHarmonics.OnUpALFs( Sender:TObject );
begin
_OnChange.Run( Self );
end;
function TdSPHarmonics.GetALFs :TdALFs;
begin
Result := _dALFs;
end;
procedure TdSPHarmonics.SetALFs( const ALFs_:TdALFs );
begin
if Assigned( _dALFs ) then _dALFs.OnChange.Del( OnUpALFs );
_dALFs := ALFs_;
if Assigned( _dALFs ) then _dALFs.OnChange.Add( OnUpALFs );
OnUpALFs( Self );
end;
//------------------------------------------------------------------------------
function TdSPHarmonics.GetDegN :Integer;
begin
Result := _dALFs.DegN;
end;
procedure TdSPHarmonics.SetDegN( const DegN_:Integer );
begin
_dALFs.DegN := DegN_;
end;
//------------------------------------------------------------------------------
function TdSPHarmonics.GetAngleX :TdDouble;
begin
Result := _AngleX;
end;
procedure TdSPHarmonics.SetAngleX( const AngleX_:TdDouble );
begin
_AngleX := AngleX_;
end;
function TdSPHarmonics.GetAngleY :TdDouble;
begin
Result := _AngleY;
end;
procedure TdSPHarmonics.SetAngleY( const AngleY_:TdDouble );
begin
_AngleY := AngleY_;
_dALFs.X := Cos( _AngleY );
end;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TdSPHarmonics.Create( const DegN_:Integer );
begin
inherited Create;
_dALFs.DegN := DegN_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSPHarmonics<TdNALFs_>
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
//////////////////////////////////////////////////////////////// A C C E S S O R
function TdSPHarmonics<TdNALFs_>.GetSHs( const N_,M_:Integer ) :TdDoubleC;
var
M :Integer;
A, C, S :TdDouble;
begin
M := Abs( M_ );
A := _dALFs[ N_, M ] / Sqrt( Pi2 );
SinCos( M * _AngleX, S, C );
if M_ < 0 then
begin
Result.R := A * S;
Result.I := A * C;
end
else
begin
Result.R := A * C;
Result.I := A * S;
end;
end;
function TdSPHarmonics<TdNALFs_>.GetRSHs( const N_,M_:Integer ) :TdDouble;
var
M :Integer;
A :TdDouble;
begin
M := Abs( M_ );
A := _dALFs[ N_, M ] / Sqrt( Pi2 );
if M_ < 0 then Result := A * Sin( M * _AngleX )
else Result := A * Cos( M * _AngleX );
end;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TdSPHarmonics<TdNALFs_>.Create;
begin
_dALFs := TdNALFs_.Create;
inherited;
end;
constructor TdSPHarmonics<TdNALFs_>.Create( const DegN_:Integer );
begin
_dALFs := TdNALFs_.Create;
inherited Create;
_dALFs.DegN := DegN_;
end;
destructor TdSPHarmonics<TdNALFs_>.Destroy;
begin
_dALFs.Free;
inherited;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdRSPHarmonics<TdFNALFs_>
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
//////////////////////////////////////////////////////////////// A C C E S S O R
function TdRSPHarmonics<TdFNALFs_>.GetSHs( const N_,M_:Integer ) :TdDoubleC;
var
M :Integer;
A, C, S :TdDouble;
begin
M := Abs( M_ );
A := _dALFs[ N_, M ] / Sqrt( Pi4 );
SinCos( M * _AngleX, S, C );
if M_ < 0 then
begin
Result.R := A * S;
Result.I := A * C;
end
else
begin
Result.R := A * C;
Result.I := A * S;
end;
end;
function TdRSPHarmonics<TdFNALFs_>.GetRSHs( const N_,M_:Integer ) :TdDouble;
var
M :Integer;
A :TdDouble;
begin
M := Abs( M_ );
A := _dALFs[ N_, M ] / Sqrt( Pi4 );
if M_ < 0 then Result := A * Sin( M * _AngleX )
else Result := A * Cos( M * _AngleX );
end;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TdRSPHarmonics<TdFNALFs_>.Create;
begin
_dALFs := TdFNALFs_.Create;
inherited;
end;
constructor TdRSPHarmonics<TdFNALFs_>.Create( const DegN_:Integer );
begin
_dALFs := TdFNALFs_.Create;
inherited Create;
_dALFs.DegN := DegN_;
end;
destructor TdRSPHarmonics<TdFNALFs_>.Destroy;
begin
_dALFs.Free;
inherited;
end;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【 R O U T I N E 】
end. //######################################################################### ■