08-14-2024, 12:26 PM
This line is wrong:
it should be
While we're at is, here's a version that's not so obtusely written:
Code: (Select All)
IF (L# - H#) < 1E-10 THEN 23
Code: (Select All)
IF ABS(L# - H#) < 1E-10 THEN 23
While we're at is, here's a version that's not so obtusely written:
Code: (Select All)
DefDbl A-Z
S = 279.559511
H = 40
N = _D2R(1)
F = _D2R(1)
EPSILON = 1D-10
U = Sqr(S * 2)
Do
T = U / Sqr(F - Sin(F))
L = 2 * T * Sin(F / 2)
If Abs(L - H) < EPSILON Then Print Using "##.####"; T: Exit Do
If L > H Then
F = F + N
Else
N = N / 2
F = F - N
End If
Loop