#include <stdio.h>
#include <math.h>
int main() {
double angle = 45.0;
double result = atan(angle * M_PI / 180); // 將角度轉換為弧度
printf("The arctan of %f is %f radians\n", angle, result);
return 0;
}
#include <stdio.h>
#include <math.h>
int main() {
double adjacent = 3.0;
double opposite = 4.0;
double angle = atan(opposite / adjacent) * 180 / M_PI; // 計算反正切值并將弧度轉換為角度
printf("The angle of the right triangle is %f degrees\n", angle);
return 0;
}
#include <stdio.h>
#include <math.h>
int main() {
double x1 = 1.0, y1 = 1.0;
double x2 = 2.0, y2 = 2.0;
double angle = atan((y2 - y1) / (x2 - x1)) * 180 / M_PI; // 計算兩點之間的夾角
printf("The angle between the two points is %f degrees\n", angle);
return 0;
}