C Reference function sin()

Usage of sin():

double sin(double x);

Parameters:

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():


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

	#define PI 3.14159265

	main()
	{
		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. You can leave a response, or trackback from your own site. Tweet This! Tweet This! or use to share this post with others.

Leave a Reply: