C Reference function atan()

Usage of atan():

double atan(double x);

Parameters:

The value of x has no range.

Return value:

The returned value is in the range of -p/2 to +p/2 (inclusive).

Source code example of atan():


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

	#define PI 3.14159265

	main()
	{
		double input, output;
		input = 0.5;
		output = atan (input) * 180 / PI;
		printf ("Arc tangent of %lf is %lf degrees\n", input, output );
		return 0;
	}

Output of the atan example program above:


	Arc tangent of 0.500000 is 26.565051 degrees.

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: