# Category : Miscellaneous Language Source Code

Archive : FORTRN77.ZIP

Filename : NTRTCX.FOR

C

C SUBROUTINE TO DETERMINE THE NTH ROOTS OF A COMPLEX NUMBER.

C

DIMENSION C(1), D(1)

P = N

S = 0.0

IF(N.LT.1) GO TO 43

IF(N.EQ.1) GO TO 44

THETA = ATAN2(B,A)

THETA = THETA/P

S = SQRT(A*A + B*B)

X = 1.0/P

SX = S**X

C(1) = SX*COS(THETA)

D(1) = SX*SIN(THETA)

IF (N.EQ.1) RETURN

JN = N - 1

DO 20 K = 1,JN

L = K + 1

AK = K

Z = THETA + (2.0*AK*3.1415926536)/P

Z = AMOD(Z,6.281853072)

C(L) = SX*COS(Z)

D(L) = SX*SIN(Z)

20 CONTINUE

RETURN

43 C(1) = 0.0

D(1) = 0.0

RETURN

44 C(1) = A

D(1) = B

RETURN

END

Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/