DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b019885b8⟧ TextFile

    Length: 1280 (0x500)
    Types: TextFile
    Names: »INVERS.PAS«

Derivation

└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer
    └─ ⟦this⟧ »INVERS.PAS« 
└─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80)
    └─ ⟦this⟧ »INVERS.PAS« 
└─⟦3702e543b⟧ Bits:30003064 Demoprogrammer A-J til Pascal bog
    └─ ⟦this⟧ »INVERS.PAS« 
└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
    └─ ⟦this⟧ »INVERS.PAS« 

TextFile

        PROGRAM invers;
        
          VAR
            i : INTEGER;
            x : REAL;
            
          FUNCTION arcsin(x : REAL) : REAL;
            
            BEGIN
              IF ABS(x) < 1
                THEN arcsin := ARCTAN(x / SQRT(1 - x * x))
              ELSE IF x = 1
                THEN arcsin := PI / 2
              ELSE IF x = -1
                THEN arcsin := -PI / 2;
            END;
          
          FUNCTION arccos(x : REAL) : REAL;
          
            BEGIN
              IF x = 0
                THEN arccos := PI / 2
              ELSE IF (0 < x ) AND (x <= 1)
                THEN arccos := ARCTAN(SQRT(1 - x * x) / x)
              ELSE IF (-1 <= x) AND (x < 0)
                THEN arccos := ARCTAN(SQRT(1 - x * x) / x) + PI;
            END;
          
          BEGIN (* invers *)
            WRITE(CLRHOM);
            WRITELN('x' : 4, 'ARCSIN(x)' : 15, 'ARCCOS(x)' : 15);
            WRITELN;
            FOR i := -10 TO 10 DO
              BEGIN
                x := i / 10;
                WRITELN(x : 4 : 1, arcsin(x) : 15 : 8, arccos(x) : 15 : 8);
              END;
          END. (* invers *)
«eof»