ArcFunctions

 BBS: Inland Empire Archive
Date: 03-15-93 (18:44)             Number: 318
From: MICHEL BERTLER               Refer#: NONE
  To: GEOFFREY LIU                  Recvd: NO  
Subj: ArcFunctions                   Conf: (2) Quik_Bas
In a message of <14 Mar 93>, Geoffrey Liu (1:229/15) writes:

 GL> I think he meant finding the angle from the sin. ie. from .5 to
 GL> 30*. I think it's called arcsine.

Basic's usual angular measurement unit is the radiant! If you want
to convert in degree you'll have to use the formula:

5 CLS
10 PI=3.1415926535#
20 INPUT"Enter angle (degrees) value";X
21 X1=X*PI/180
   ^^^^^^^^^^^
30 PRINT"The sine value of";X;"degrees is:";SIN(X1)
40 PRINT"The cosine value of";X;"degrees is:";COS(X1)
50 PRINT"The tangent value of";X;"degrees is:";TAN(X1)
60 PRINT"The secant value of";X;"degrees is:";1/COS(X1)
70 PRINT"The cosecant value of";X;"degrees is:";1/SIN(X1)
80 PRINT"The cotangent value of";X;"degrees is:";1/TAN(X1)
----------------------------------------------------------
Here's the Postit script of TRIG.ARJ (TRIG.BAS) which also includes
basic hyperbolic trigonometry functions. I've used this method rather
than direct Ascii posting because of excessive line length.

---- CLS:?STRING$(50,178):DEFINT A-Z 'Created by PostIt! v5.1 Y$="*+,-./":FOR A=0 TO 6:P(A)=2^A:NEXT:OPEN "B",1,"TRIG.ARJ T$="abcdefghijklmnopqrstuvwxyz":T$=T$+UCASE$(T$)+"0123456789() G"GPoka4bbb*eaiqabu5BA///+qLujDKlbjLs*WjTGCC+yQJ G"caEqq+r*eqzm0Mgme+K6+GOsNDz+i,ujvsh5Iqbnf*mfEW6f+W2ATz1 G"1GY5W3Znx8ixRa7Y)xP1s7gcgdo8HjjwEy1BTdzrfI2lo6vtY2aOWQfQl(ejGwqOxWHlTb G"bkar2RJUcxaJDoqIpNP5CviyNsh(j7eM95SMglZLoMk9kCPtQrLUy5C4TiNjgtaYsqwYYd G"HcOXktyAJOh00BYHqzzQN1HClFKENPtBaUulDzGDeWdRajlHUPUKrT)w3qLgRNtDQnDKmw G"F)xF4PIXUxzIrYFuoyIznh(NBp23k2X6ET(PfdBDj5669R)eWP2MyPt(4lR45jSdqVEE9t G"cZSho7o43SFN2)4W4IhCF4xX)cI9gr5j4)n(ZNF)hxB9a)d5xH7I)rYBG3vO3NjW8bsO5a G"ayQd*" N=372:K=255:IF LEN(C$)<>496 THEN ?"Incomplete script!":END FOR A=1 TO N:LOCATE 1:?STRING$(50/N*A,177):IF L=0 THEN GOSUB G:L=6 W=T\P(6-L):GOSUB G:W=W OR T*P(L):L=L-2:B$=CHR$(W AND K):PUT 1,,B$:NEXT ?:IF C=131 THEN ?"Ok":END ELSE ?"Bad checksum!":END G:I=I+1:T=INSTR(T$,MID$(C$,I,1))-1:C=(C+T)*2:C=C\256+(C AND 255):RETURN SUB G(A$):SHARED C$,Y$:FOR Q=1 TO 6:DO:S=INSTR(A$,CHR$(Q+41)) IF S THEN A$=LEFT$(A$,S-1)+STRING$(Q+1,97)+MID$(A$,S+1) LOOP WHILE S:NEXT:C$=C$+A$:END SUB
--- Michel --- GoldED * Origin: Blainville, Quebec (1:242/130)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET