#include <stdio.h>
#include <math.h>
typedef struct{
double x;
double y;
}Pos;
int main(void){
Pos pos1, pos2;
double ta, rad, dir;
puts("座標を二つ入力してください");
printf("X1:"); scanf("%lf", pos1.x);
printf("Y1:"); scanf("%lf", pos1.y);
printf("X2:"); scanf("%lf", pos2.x);
printf("Y2:"); scanf("%lf", pos2.y);
ta = sqrt((pos1.y - pos2.y) * (pos1.y - pos2.y)) / sqrt((pos1.x - pos2.x) * (pos1.x - pos2.x));
rad = atan(ta);
dir = rad / (3.14159265358979 * 180.0);
printf("二点間の角度は%fです", dir);
return(0);
}
あと、角度の出し方自体も色々サイトを見ながら作ったのですが、不安なのでそちらのほうも出来ればお願いします。最近雷ばっかりでパソコンつけるの恐いです…