VTK 的 Math 两个三维点之间的平方距离和欧几里得距离

VTK 的 Math 库,计算两个三维点之间的平方距离和欧几里得距离

#include 

int main(int, char* [])
{
	// Create two points.
	double p0[3] = { 0.0, 0.0, 0.0 };
	double p1[3] = { 1.0, 1.0, 1.0 };
	double squaredDistance = vtkMath::Distance2BetweenPoints(p0, p1);
	double distance = std::sqrt(squaredDistance);
	std::cout << "SquaredDistance = " << squaredDistance << std::endl;
	std::cout << "Distance = " << distance << std::endl;
	return 0;
}

在这里插入图片描述

你可能感兴趣的:(图像处理)