C Reference function sin()

Usage of sin():

double sin(double x);


The value of x has no range.

Return value:

The returned value is in the range of -1 to +1 (inclusive).

Source code example of sin():


	#define PI 3.14159265

		double input, output;
		input = 25.0;
		output = sin (input*PI/180);
		printf ("Sine of %lf degrees is %lf\n", input, output );
		return 0;

Output of the sin example program above:

	Sine of 25.000000 degrees is 0.422618

This entry was posted in C Reference math.h Functions. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed. Tweet This! Tweet This! or use to share this post with others.

Comments are closed.