Both atan and atan2 are antitangent functions, such as two vertices (x1, y1) and point (x2, y2 ); then the two points form the slope angle calculation method is: floatangleatan (y2-y1) (x2-x1); or floatangleatan2 (y2-y1, x2-x1); atan and atan2 difference: 1: parameter filling method not
Both atan and atan2 are antitangent functions, such as two vertices (x1, y1) and point (x2, y2 ); then the two points form the slope of the angle calculation method is: floatangle = atan (y2-y1)/(x2-x1); or float angle = atan2 (y2-y1, x2-x1 ); differences between atan and atan2: 1: The parameter filling method is not
Both atan and atan2 are antitangent functions, such as two vertices (x1, y1) and point (x2, y2 );
The Angle Calculation Method for the slope formed by these two points is:
Float angle = atan (y2-y1)/(x2-x1 ));
Or
Float angle = atan2 (y2-y1, x2-x1 );
Differences between atan and atan2:
1: parameters are entered in different ways;
2: atan2 advantage is that if the x2-x1 is equal to 0 can still be calculated, but the atan function will cause program errors;
Conclusion: atan and atan2 functions are recommended;