typedef long long LL;
typedef unsigned long long ULL;
typedef vector <int> VI;
const int INF = 0x3f3f3f3f;
const double eps = 1e-10;
const int MOD = 100000007;
const int MAXN = 1000010;
const double PI = acos(-1.0);
struct Point
{
double x, y, z;
Point(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {}
inline void read() { scanf("%lf%lf%lf", &x, &y, &z); }
};
typedef Point Vector;
inline Point operator+ (Point A, Point B) { return Point(A.x + B.x, A.y + B.y, A.z + B.z); }
inline Point operator- (Point A, Point B) { return Point(A.x - B.x, A.y - B.y, A.z - B.z); }
inline Point operator* (Point A, double t) { return Point(A.x * t, A.y * t, A.z * t); }
inline Point operator/ (Point A, double t) { return Point(A.x / t, A.y / t, A.z / t); }
struct Line
{
Point p;
Vector v;
Line(Point p, Vector v) : p(p), v(v) {}
Line() {}
inline void re
三维空间异面直线的距离及最近点
最新推荐文章于 2023-05-31 23:26:05 发布
本文介绍了如何在三维空间中计算两条异面直线之间的最近点。通过定义点和向量的结构,使用计算几何的方法,计算两直线的交点,并输出最近点的坐标和距离。
摘要由CSDN通过智能技术生成