// 计算点到直线的距离 // D = ||(P2-P1) x (P1-P0)|| / ||P2-P1|| = norm (cross (p2-p1, p1-p0)) / norm(p2-p1) // 返回点到直线的距离的平方 double inline sqrPointToLineDistance (const Eigen::Vector4f &pt, const Eigen::Vector4f &line_pt, const Eigen::Vector4f &line_dir) { return (line_dir.cross3 (line_pt - pt)).squaredNorm () / line_dir.squaredNorm (); }

注释代码用中文double inline sqrPointToLineDistance const EigenVector4f &pt const EigenVector4f &line_pt const EigenVector4f &line_dir Calculate the distance from the point to the line D = P2-P1 x

原文地址: https://www.cveoy.top/t/topic/hNPT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录