c语言平面两点间距离

2025-01-02 04:33:58
推荐回答(1个)
回答1:

# define struct {
double x, y;
} point;
double distance(point a, b)
{
return (sqrt( (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) ));
}