P
Patrick Sullivan
I want to use this algorithm but can't figure it out, I never used BASIC. I
tried translating it but got lost in the gosubs and "for i - 1 to ...
nexts". I have figured out that FNU(X) is degree to radians, and FNY is a
modulo, but those are not what get me confused, it's just this section here.
Anyone in here with "old school BASIC" experience who can unravel this for
fun?
1740 DEF FN Y(X) = ATN(SQR(1 - X * X) / X):Y = 0:MO = 360
H(4) = fN U(MC + 180):H(1) = FN U(AS)
1745 R1 = RA + FN R(30):FF = 3: GOSUB 1770:H(5) = FN U(LO + 180
1750 R1 = RA + FN R(60):FF = 1.5: GOSUB 1770:H(6) = FN U(LO + 180
R1 = RA + FN R(120):Y = 1
1755 GOSUB 1770:H(2) = LO:R1 = RA + FN R(150):FF = 3; GOSUB 1770:
H(3) = LO
1760 FOR I = 1 TO 12:H(I) = FN U(H(I)): IF I < 6 THEN H(I) = FN U(H(I-6)
+ 180)
1765 C = H(I): GOSUB 1190:H$(I) = A$: NEXT I: RETURN
1770 X = - 1: IF Y = 1 THEN X = 1
1775 FOR I = 1 TO 10:XX = FN y(X * SIN(R1) * TAN(OB) * TAN(LA)): IF XX < 0
THEN XX = XX * PI
1780 R2 = RA + (XX /FF): IF Y = 1 THEN R2 - RA + PI - (XX / FF)
1785 R1= R2: NEXT 1:LO = ATN(TAN(R1)) / COS(OB)): IF LO < 0 THEN LO = LO +
PI
1790 IF SIN(R1) < 0 THEN LO = LO + PI
1795 LO = FN D(LO): RETURN
TIA
tried translating it but got lost in the gosubs and "for i - 1 to ...
nexts". I have figured out that FNU(X) is degree to radians, and FNY is a
modulo, but those are not what get me confused, it's just this section here.
Anyone in here with "old school BASIC" experience who can unravel this for
fun?
1740 DEF FN Y(X) = ATN(SQR(1 - X * X) / X):Y = 0:MO = 360
H(4) = fN U(MC + 180):H(1) = FN U(AS)
1745 R1 = RA + FN R(30):FF = 3: GOSUB 1770:H(5) = FN U(LO + 180
1750 R1 = RA + FN R(60):FF = 1.5: GOSUB 1770:H(6) = FN U(LO + 180
R1 = RA + FN R(120):Y = 1
1755 GOSUB 1770:H(2) = LO:R1 = RA + FN R(150):FF = 3; GOSUB 1770:
H(3) = LO
1760 FOR I = 1 TO 12:H(I) = FN U(H(I)): IF I < 6 THEN H(I) = FN U(H(I-6)
+ 180)
1765 C = H(I): GOSUB 1190:H$(I) = A$: NEXT I: RETURN
1770 X = - 1: IF Y = 1 THEN X = 1
1775 FOR I = 1 TO 10:XX = FN y(X * SIN(R1) * TAN(OB) * TAN(LA)): IF XX < 0
THEN XX = XX * PI
1780 R2 = RA + (XX /FF): IF Y = 1 THEN R2 - RA + PI - (XX / FF)
1785 R1= R2: NEXT 1:LO = ATN(TAN(R1)) / COS(OB)): IF LO < 0 THEN LO = LO +
PI
1790 IF SIN(R1) < 0 THEN LO = LO + PI
1795 LO = FN D(LO): RETURN
TIA