08-14-2024, 09:56 AM
I have no idea what's wrong with it, as it's mainly just a math formula, but here it is without all the GOTO and spaghetti code, if that helps anyone else sort out what it might possibly be doing wrong:
Code: (Select All)
P# = 3.141592653589793#
K# = 57.29577951308232#
S# = 279.559511
H# = 40
Cls: N# = 1: F# = 1
Do
T# = Sqr(2#) * Sqr(S# / (P# * F# / 180# - Sin(F# / K#))): L# = 2 * T# * Sin(F# / 2 / K#)
If (L# - H#) < 1D-10 Then Print Using "##.####"; T#: Exit Do
If H# > L# Then F# = F# - N#: N# = N# / 2
F# = F# + N#
Loop
Print " Ok."