Hàm sin, cos, tan

double sin( double x );
double cos( double x );
double tan( double x);

Parameter:

x: góc (radian)

Remark:

Hàm trả về sin(x), cos(x), tan(x).

Ví dụ:

#include <math.h>
#include "conio.h"
#include <stdio.h>

void main( void )
{
    double pi = 3.1415926535;
    double x, y;

    x = pi / 2;
    y = sin( x );
    printf( "sin( %f ) = %f\n", x, y );
    y = cos( x );
    printf( "cos( %f ) = %f\n", x, y );
    y = tan( x );
    printf( "tan( %f ) = %f\n", x, y );
    getch();
}

Kết quả:

Hàm sin, cos, tan

Be the first to comment

Leave a Reply