Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
TRIG.PAS
◄Example► ◄Contents► ◄Index► ◄Back►
PROGRAM trig;
{ TRIG.PAS illustrates trigonometric functions, including:
Arctan Cos Pi Sin
}
CONST
program_name = 'TRIG ';
program_desc = 'demonstrates the trigonometric functions.';
VAR
x : Real;
BEGIN
Writeln( program_name, program_desc );
Writeln;
REPEAT
Write( 'Enter a real number between 1 and -1: ' );
Readln( x );
UNTIL ((x > -1.0) AND (x < 1.0));
Writeln;
Writeln( 'Function Result for ', x:12:10 );
Writeln( '-------- -----------------------' );
Writeln( 'cos ', Cos( x ) );
Writeln( 'sin ', Sin( x ) );
Writeln( 'arctan ', ArcTan( x ) );
Writeln;
Writeln( 'Function Result for ', Pi:12:10 );
Writeln( '-------- -----------------------' );
Writeln( 'cos ', Cos( Pi) );
Writeln( 'sin ', Sin( Pi) );
Writeln( 'Arctan ', ArcTan( Pi ) );
Writeln;
Write( 'Enter a real number of any value: ' );
Readln( x );
Writeln;
Writeln( 'Function Result for ', x:12:10 );
Writeln( '-------- -----------------------' );
Writeln( 'cos ', Cos( x ) );
Writeln( 'sin ', Sin( x ) );
Writeln( 'arctan ', ArcTan( x ) );
END.