Skip to content

Commit 09d5da4

Browse files
committed
some new pngs
1 parent de66a28 commit 09d5da4

15 files changed

+245
-139
lines changed

Classes/Angle.cls

Lines changed: 105 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ End Sub
2727
Friend Sub NewG_(angleInGon As Double)
2828
m_Angle = angleInGon * MMath.Pi / 200#
2929
End Sub
30-
Friend Sub NewDMS_(aDeg As Long, aMin As Double, aSec As Double)
30+
Friend Sub NewDMS_(ByVal aDeg As Long, ByVal aMin As Double, ByVal aSec As Double)
3131
m_Angle = (aDeg + aMin / 60# + aSec / 3600#) * MMath.Pi / 180#
3232
End Sub
3333
'copy to MNew:
@@ -229,6 +229,12 @@ Public Property Get GradF() As Double
229229
Dim eps As Double: eps = Abs(Abs(GradF) - Abs(rgf))
230230
If eps <= 0.0000000001 Then GradF = rgf
231231
End Property
232+
'Public Property Let GradF(ByVal Value)
233+
' Dim gd ', md, sd
234+
' SeparateDMS m_Angle, gd, , md, , sd
235+
' NewDMS_ Value, gd, sd
236+
'End Property
237+
232238
Public Property Get Grad() As Long
233239
SeparateDMS m_Angle, , Grad
234240
Grad = Sgn(m_Angle) * Grad
@@ -237,12 +243,23 @@ Public Property Get Grad() As Long
237243
'Dim eps As Double: eps = Abs(gf - rgf)
238244
'If eps < 0.00000001 Then Grad = Sgn(m_angle) * rgf Else Grad = Sgn(m_angle) * CDbl(Int(gf))
239245
End Property
246+
Public Property Let Grad(ByVal Value As Long)
247+
Dim gi As Long, mi As Long, sd As Double
248+
SeparateDMS m_Angle, , gi, , mi, sd
249+
NewDMS_ Value, mi, sd
250+
End Property
240251

241252
Public Property Get MinuteF() As Double
242253
SeparateDMS m_Angle, , , MinuteF
243254
MinuteF = Sgn(m_Angle) * MinuteF
244255
'MinuteF = (Abs(GradF) - Abs(Grad)) * 60#
245256
End Property
257+
'Public Property Let MinuteF(ByVal Value)
258+
' Dim gi As Long, md ', sd
259+
' SeparateDMS m_Angle, , gi, md, , sd
260+
' NewDMS_ gi, Value, sd
261+
'End Property
262+
246263
Public Property Get Minute() As Long
247264
SeparateDMS m_Angle, , , , Minute
248265
Minute = Sgn(m_Angle) * Minute
@@ -251,12 +268,23 @@ Public Property Get Minute() As Long
251268
'Dim eps As Double: eps = Abs(mf - rmf)
252269
'If eps < 0.00000001 Then Minute = Sgn(m_angle) * rmf Else Minute = Sgn(m_angle) * CDbl(Int(mf))
253270
End Property
271+
Public Property Let Minute(ByVal Value As Long)
272+
Dim gi As Long, mi As Long, sd As Double
273+
SeparateDMS m_Angle, , gi, , mi, sd
274+
NewDMS_ gi, Value, sd
275+
End Property
254276

255277
Public Property Get SecondF() As Double
256278
'SecondF = (MinuteF - Minute) * 60#
257279
SeparateDMS m_Angle, , , , , SecondF
258280
SecondF = Sgn(m_Angle) * SecondF
259281
End Property
282+
Public Property Let SecondF(ByVal Value As Double)
283+
Dim gi As Long, mi As Long, sd As Double
284+
SeparateDMS m_Angle, , gi, , mi, sd
285+
NewDMS_ gi, mi, Value
286+
End Property
287+
260288
Public Property Get Second() As Long
261289
SeparateDMS m_Angle, , , , , , Second
262290
Second = Sgn(m_Angle) * Second
@@ -265,17 +293,33 @@ Public Property Get Second() As Long
265293
'Dim eps As Double: eps = Abs(sf - rsf)
266294
'If eps < 0.00000001 Then Second = rsf Else Second = CDbl(Int(sf))
267295
End Property
296+
Public Property Let Second(ByVal Value As Long)
297+
Dim gi As Long, mi As Long, si As Long, msd As Double
298+
SeparateDMS m_Angle, , gi, , mi, , si, msd
299+
NewDMS_ gi, mi, CDec(Value) + CDec(msd) / CDec(1000)
300+
End Property
268301

269302
Public Property Get MillisecF() As Double
270303
SeparateDMS m_Angle, , , , , , , MillisecF
271304
MillisecF = Sgn(m_Angle) * MillisecF
272305
'MillisecF = (SecondF - Second) * 1000#
273306
End Property
307+
Public Property Let MillisecF(ByVal Value As Double)
308+
Dim gi As Long, mi As Long, si As Long
309+
SeparateDMS m_Angle, , gi, , mi, , si
310+
NewDMS_ gi, mi, CDec(CDec(si) + CDec(Value) / CDec(1000))
311+
End Property
312+
274313
Public Property Get Millisec() As Long
275314
'Millisec = Int(MillisecF)
276315
SeparateDMS m_Angle, , , , , , , , Millisec
277316
Millisec = Sgn(m_Angle) * Millisec
278317
End Property
318+
Public Property Let Millisec(ByVal Value As Long)
319+
Dim gi As Long, mi As Long, si As Long
320+
SeparateDMS m_Angle, , gi, , mi, , si
321+
NewDMS_ gi, mi, CDec(CDec(si) + CDec(Value) / CDec(1000))
322+
End Property
279323

280324
Private Sub SeparateDMS(ByVal angleRad_in As Double, Optional gd_out As Double, Optional gi_out As Long, _
281325
Optional md_out As Double, Optional mi_out As Long, _
@@ -346,26 +390,26 @@ Public Function Cotangens() As Double ' aka cot
346390
End Function
347391

348392
' ############################## ' trigonometric inverse funktions ' ############################## '
349-
Public Function ArcusSinusF(ByVal Y As Double) As Double ' aka arcsin
350-
Select Case Y
393+
Public Function ArcusSinusF(ByVal y As Double) As Double ' aka arcsin
394+
Select Case y
351395
Case 1
352396
ArcusSinusF = 0.5 * MMath.Pi
353397
Case -1
354398
ArcusSinusF = -0.5 * MMath.Pi
355399
Case -1 To 1
356-
ArcusSinusF = VBA.Math.Atn(Y / Sqr(1 - Y * Y))
400+
ArcusSinusF = VBA.Math.Atn(y / Sqr(1 - y * y))
357401
End Select
358402
End Function
359-
Public Function ArcusSinus(ByVal Y As Double) As Angle ' aka arcsin
360-
Set ArcusSinus = New Angle: ArcusSinus.New_ ArcusSinusF(Y)
403+
Public Function ArcusSinus(ByVal y As Double) As Angle ' aka arcsin
404+
Set ArcusSinus = New Angle: ArcusSinus.New_ ArcusSinusF(y)
361405
End Function
362406

363-
Public Function ArcusCosinusF(ByVal X As Double) As Double ' aka arccos
364-
If X < -1 Or 1 < X Then Exit Function
365-
ArcusCosinusF = 0.5 * MMath.Pi - ArcusSinusF(X)
407+
Public Function ArcusCosinusF(ByVal x As Double) As Double ' aka arccos
408+
If x < -1 Or 1 < x Then Exit Function
409+
ArcusCosinusF = 0.5 * MMath.Pi - ArcusSinusF(x)
366410
End Function
367-
Public Function ArcusCosinus(ByVal X As Double) As Angle ' aka arccos
368-
Set ArcusCosinus = New Angle: ArcusCosinus.New_ ArcusCosinusF(X)
411+
Public Function ArcusCosinus(ByVal x As Double) As Angle ' aka arccos
412+
Set ArcusCosinus = New Angle: ArcusCosinus.New_ ArcusCosinusF(x)
369413
End Function
370414

371415
Public Function ArcusTangensF(ByVal T As Double) As Double ' aka arctan
@@ -376,53 +420,53 @@ Public Function ArcusTangens(ByVal T As Double) As Angle ' aka arctan
376420
End Function
377421

378422
'ArcusTangensXY: also known as ATan2
379-
Public Function ArcusTangensXYF(ByVal X As Double, _
380-
ByVal Y As Double) As Double ' aka atan2
381-
If Y > 0 Then
382-
If X > 0 Then ' 1. Quadrant
383-
ArcusTangensXYF = Atn(Abs(Y) / Abs(X)) '+ MMath.Pi * 0#
384-
ElseIf X < 0 Then ' 2. Quadrant
385-
ArcusTangensXYF = -Atn(Abs(Y) / Abs(X)) + MMath.Pi '* 1#
423+
Public Function ArcusTangensXYF(ByVal x As Double, _
424+
ByVal y As Double) As Double ' aka atan2
425+
If y > 0 Then
426+
If x > 0 Then ' 1. Quadrant
427+
ArcusTangensXYF = Atn(Abs(y) / Abs(x)) '+ MMath.Pi * 0#
428+
ElseIf x < 0 Then ' 2. Quadrant
429+
ArcusTangensXYF = -Atn(Abs(y) / Abs(x)) + MMath.Pi '* 1#
386430
Else 'If x = 0 Then ' pos. Y-Achse
387431
ArcusTangensXYF = 0.5 * MMath.Pi
388432
End If
389-
ElseIf Y < 0 Then
390-
If X < 0 Then ' 3. Quadrant
391-
ArcusTangensXYF = Atn(Abs(Y) / Abs(X)) + MMath.Pi '* 1#
392-
ElseIf X > 0 Then ' 4. Quadrant
393-
ArcusTangensXYF = -Atn(Abs(Y) / Abs(X)) + MMath.Pi * 2
433+
ElseIf y < 0 Then
434+
If x < 0 Then ' 3. Quadrant
435+
ArcusTangensXYF = Atn(Abs(y) / Abs(x)) + MMath.Pi '* 1#
436+
ElseIf x > 0 Then ' 4. Quadrant
437+
ArcusTangensXYF = -Atn(Abs(y) / Abs(x)) + MMath.Pi * 2
394438
Else 'If x = 0 Then ' neg. Y-Achse
395439
ArcusTangensXYF = 1.5 * MMath.Pi
396440
End If
397441
Else 'If y = 0 Then
398-
If X > 0 Then ' pos. X-Achse
442+
If x > 0 Then ' pos. X-Achse
399443
ArcusTangensXYF = 0
400-
ElseIf X < 0 Then ' neg. X-Achse
444+
ElseIf x < 0 Then ' neg. X-Achse
401445
ArcusTangensXYF = MMath.Pi
402446
Else 'If x = 0 Then ' Nullpunkt
403447
ArcusTangensXYF = 0
404448
End If
405449
End If
406450
End Function
407-
Public Function ArcusTangensXY(ByVal X As Double, _
408-
ByVal Y As Double) As Angle ' aka atan2
409-
Set ArcusTangensXY = New Angle: ArcusTangensXY.New_ ArcusTangensXYF(X, Y)
451+
Public Function ArcusTangensXY(ByVal x As Double, _
452+
ByVal y As Double) As Angle ' aka atan2
453+
Set ArcusTangensXY = New Angle: ArcusTangensXY.New_ ArcusTangensXYF(x, y)
410454
End Function
411455

412-
Public Function ArcusCosecansF(ByVal Y As Double) As Double ' aka arccsc
413-
If Y = 0 Then Exit Function
414-
ArcusCosecansF = ArcusSinusF(1 / Y)
456+
Public Function ArcusCosecansF(ByVal y As Double) As Double ' aka arccsc
457+
If y = 0 Then Exit Function
458+
ArcusCosecansF = ArcusSinusF(1 / y)
415459
End Function
416-
Public Function ArcusCosecans(ByVal Y As Double) As Angle ' aka arccsc
417-
Set ArcusCosecans = New Angle: ArcusCosecans.New_ ArcusCosecansF(Y)
460+
Public Function ArcusCosecans(ByVal y As Double) As Angle ' aka arccsc
461+
Set ArcusCosecans = New Angle: ArcusCosecans.New_ ArcusCosecansF(y)
418462
End Function
419463

420-
Public Function ArcusSecansF(ByVal X As Double) As Double ' aka arcsec
421-
If X = 0 Then Exit Function
422-
ArcusSecansF = ArcusCosinusF(1 / X)
464+
Public Function ArcusSecansF(ByVal x As Double) As Double ' aka arcsec
465+
If x = 0 Then Exit Function
466+
ArcusSecansF = ArcusCosinusF(1 / x)
423467
End Function
424-
Public Function ArcusSecans(ByVal X As Double) As Angle ' aka arcsec
425-
Set ArcusSecans = New Angle: ArcusSecans.New_ ArcusSecansF(X)
468+
Public Function ArcusSecans(ByVal x As Double) As Angle ' aka arcsec
469+
Set ArcusSecans = New Angle: ArcusSecans.New_ ArcusSecansF(x)
426470
End Function
427471

428472
Public Function ArcusCotangensF(ByVal T As Double) As Double ' aka arccot
@@ -456,19 +500,19 @@ Public Function CotangensHyperbolicus() As Double ' aka coth
456500
End Function
457501

458502
' ###################### ' hyperbolic inverse funktions ' ###################### '
459-
Public Function AreaSinusHyperbolicusF(ByVal Y As Double) As Double ' aka arsinh
460-
AreaSinusHyperbolicusF = VBA.Math.Log(Y + Sqr(Y * Y + 1))
503+
Public Function AreaSinusHyperbolicusF(ByVal y As Double) As Double ' aka arsinh
504+
AreaSinusHyperbolicusF = VBA.Math.Log(y + Sqr(y * y + 1))
461505
End Function
462-
Public Function AreaSinusHyperbolicus(ByVal Y As Double) As Angle ' aka arsinh
463-
Set AreaSinusHyperbolicus = New Angle: AreaSinusHyperbolicus.New_ AreaSinusHyperbolicusF(Y)
506+
Public Function AreaSinusHyperbolicus(ByVal y As Double) As Angle ' aka arsinh
507+
Set AreaSinusHyperbolicus = New Angle: AreaSinusHyperbolicus.New_ AreaSinusHyperbolicusF(y)
464508
End Function
465509

466-
Public Function AreaCosinusHyperbolicusF(ByVal X As Double) As Double ' aka arcosh
467-
If X < 1 Then Exit Function
468-
AreaCosinusHyperbolicusF = VBA.Math.Log(X + Sqr(X * X - 1))
510+
Public Function AreaCosinusHyperbolicusF(ByVal x As Double) As Double ' aka arcosh
511+
If x < 1 Then Exit Function
512+
AreaCosinusHyperbolicusF = VBA.Math.Log(x + Sqr(x * x - 1))
469513
End Function
470-
Public Function AreaCosinusHyperbolicus(ByVal X As Double) As Angle ' aka arcosh
471-
Set AreaCosinusHyperbolicus = New Angle: AreaCosinusHyperbolicus.New_ AreaCosinusHyperbolicusF(X)
514+
Public Function AreaCosinusHyperbolicus(ByVal x As Double) As Angle ' aka arcosh
515+
Set AreaCosinusHyperbolicus = New Angle: AreaCosinusHyperbolicus.New_ AreaCosinusHyperbolicusF(x)
472516
End Function
473517

474518
Public Function AreaTangensHyperbolicusF(ByVal T As Double) As Double ' aka artanh
@@ -479,26 +523,26 @@ Public Function AreaTangensHyperbolicus(ByVal T As Double) As Angle ' aka ar
479523
Set AreaTangensHyperbolicus = New Angle: AreaTangensHyperbolicus.New_ AreaTangensHyperbolicusF(T)
480524
End Function
481525

482-
Public Function AreaCosecansHyperbolicusF(ByVal X As Double) As Double ' aka arcsch
483-
If X = 0 Then Exit Function
484-
AreaCosecansHyperbolicusF = VBA.Math.Log((Sgn(X) * Sqr(X * X + 1) + 1) / X)
526+
Public Function AreaCosecansHyperbolicusF(ByVal x As Double) As Double ' aka arcsch
527+
If x = 0 Then Exit Function
528+
AreaCosecansHyperbolicusF = VBA.Math.Log((Sgn(x) * Sqr(x * x + 1) + 1) / x)
485529
End Function
486-
Public Function AreaCosecansHyperbolicus(ByVal X As Double) As Angle ' aka arcsch
487-
Set AreaCosecansHyperbolicus = New Angle: AreaCosecansHyperbolicus.New_ AreaCosecansHyperbolicusF(X)
530+
Public Function AreaCosecansHyperbolicus(ByVal x As Double) As Angle ' aka arcsch
531+
Set AreaCosecansHyperbolicus = New Angle: AreaCosecansHyperbolicus.New_ AreaCosecansHyperbolicusF(x)
488532
End Function
489533

490-
Public Function AreaSecansHyperbolicusF(ByVal X As Double) As Double ' aka arsech
491-
If X <= 0 Or 1 <= X Then Exit Function
492-
AreaSecansHyperbolicusF = VBA.Math.Log((Sqr(-X * X + 1) + 1) / X)
534+
Public Function AreaSecansHyperbolicusF(ByVal x As Double) As Double ' aka arsech
535+
If x <= 0 Or 1 <= x Then Exit Function
536+
AreaSecansHyperbolicusF = VBA.Math.Log((Sqr(-x * x + 1) + 1) / x)
493537
End Function
494-
Public Function AreaSecansHyperbolicus(ByVal X As Double) As Angle ' aka arsech
495-
Set AreaSecansHyperbolicus = New Angle: AreaSecansHyperbolicus.New_ AreaSecansHyperbolicusF(X)
538+
Public Function AreaSecansHyperbolicus(ByVal x As Double) As Angle ' aka arsech
539+
Set AreaSecansHyperbolicus = New Angle: AreaSecansHyperbolicus.New_ AreaSecansHyperbolicusF(x)
496540
End Function
497541

498-
Public Function AreaCotangensHyperbolicusF(ByVal X As Double) As Double ' aka arcoth
499-
If X < -1 Or 1 < X Then AreaCotangensHyperbolicusF = VBA.Math.Log((X + 1) / (X - 1)) / 2
542+
Public Function AreaCotangensHyperbolicusF(ByVal x As Double) As Double ' aka arcoth
543+
If x < -1 Or 1 < x Then AreaCotangensHyperbolicusF = VBA.Math.Log((x + 1) / (x - 1)) / 2
500544
End Function
501-
Public Function AreaCotangensHyperbolicus(ByVal X As Double) As Angle ' aka arcoth
502-
Set AreaCotangensHyperbolicus = New Angle: AreaCotangensHyperbolicus.New_ AreaCotangensHyperbolicusF(X)
545+
Public Function AreaCotangensHyperbolicus(ByVal x As Double) As Angle ' aka arcoth
546+
Set AreaCotangensHyperbolicus = New Angle: AreaCotangensHyperbolicus.New_ AreaCotangensHyperbolicusF(x)
503547
End Function
504548

0 commit comments

Comments
 (0)