Benutzung auf eigene Gefahr ! |
Beschreibung |
Die Umkehrfunktion zur Involut-Funktion, die ebenfalls bei der Berechnung von Evolventenverzahnungen benötigt wird. |
VBA-Quelltext |
' Calculation of InverseInvolut() Public Function InverseInvolute(InvoluteValue As Double, _ Optional Degrees As Boolean = False, _ Optional Accuracy As Double = 0.000001) ' InvoluteValue: Given value of involte Function ' Degrees: True = Calculate Return value In degrees ' Accuracy: Accuracy For stop of iteration ' InversInvolut: Angle (Return value of the Function) ' Advises Excel To recalculate on changes Application.Volatile True ' Exception: Error, If InvoluteValue Not betweeen 0...1,2937 If (InvoluteValue < 0) Or (1.2937 <= InvoluteValue) Then InverseInvolute = CVErr(xlErrNA) Exit Function End If ' Input 0 returns Function value 0 If InvoluteValue = 0 Then Exit Function ' Initial guess For Alpha As Input For iteration step Dim OldA As Double ' Refined guess For Alpha calculated In iteration step Dim NewA As Double ' Initial guess For iteration NewA = Abs(3 * InvoluteValue) ^ 0.333 * Sgn(InvoluteValue) ' Start iteration Loop Do OldA = NewA NewA = OldA + ((OldA + InvoluteValue) / Tan(OldA) - 1) / Tan(OldA) ' Continue, If accuracy Not sufficient Loop Until Abs((NewA - OldA) / (NewA + OldA)) < Accuracy ' Convert To degrees, If required If Degrees Then NewA = WorksheetFunction.Degrees(NewA) ' Return Result InverseInvolute = NewA End Function |
Argumente der Funktion/Prozedur |
|
Hinweis |
Die Berechnung erfolgt über eine Iteration. Die Geschwindigkeit ist daher von der gewünschten Genauigkeit abhängig. |