This function is compatible with the following targets:
|
|
#include <math.h>
double sin(double x);
float sinf(float x);
long double sinl(long double x);Parameters:
Parameters for this function are:
The argument for the sin() function should be in radians. One radian is equal to 360/2
degrees.
sin() returns the sine of x. x is measured in radians.
#include <math.h>
#include <stdio.h>
#define DtoR 2*pi/360
int main(void)
{
double x = 57.0;
double xRad = x*DtoR;
printf("The sine of %.2f degrees is %.4f.\n",x, sin(xRad));
return 0;
}
Output:
The sine of 57.00 degrees is 0.8387.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000