Tell me about the angles of inverse trigonometric functions atan, radians and angles.

Source: Internet
Author: User

We are usually in the mathematical calculation is, often use trigonometric and inverse trigonometric functions, the most commonly used inverse trigonometric functions is probably atan, because this is equivalent to a given two points between the line angle.

1, tangent function image


At this point tangent function image, high school we should know, the tangent function is a periodic function, that is, the same value, there are many angle values corresponding, then we use the MATH.H Math library function atan2 (y,x), the return of what exactly is it.

2, Radian system and angle conversion

Inverse Trigonometric Functions return value is Radian system, to change angle system, need *180/π. Pi is 3.1415926.

3, the return value of the inverse tangent function atan2

The best way to solve doubt is to practice. Because the work to calculate the two points of the angle, for (y,x) (+,+), (+,-), (-,+), (-,-), the return angle in the end is not quite sure, so use the following program to verify.

#include "stdafx.h"
#include <iostream>
using namespace  std;
#define F_path "D:\\project\\testtest\\test_tan\\test_tan\\1.txt"  
#define  PI 3.1415926
int _tmain ( int argc, _tchar* argv[])
{

	double ang = 0.0;
	Double  angle = 0.0;

	Angle = atan2 (2.0,1.0);              The
	angle*180/pi ang = the;
	cout << ang <<endl;

	Angle = atan2 ( -2.0,1.0);     -63, 4 quadrant
	ang = angle*180/pi;
	cout << ang <<endl;

	Angle = atan2 (2.0,-1.0);            116  , 2 quadrant
	ang = angle*180/pi;
	cout << ang <<endl;

	Angle = atan2 ( -2.0,-1.0);            -116   3 quadrant
	ang = angle*180/pi;
	cout << ang <<endl; 
	Cin.get ();
	return 0;
}
The result of the program running is:


In fact, the results are also very well understood, the program according to (X,y) positive and negative to determine the quadrant, the one or two quadrant is positive, three or four quadrant is negative. The return angle range is (-180,180).


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.