三个球体的交点在ProGAL中给出了错误的坐标

时间:2014-05-28 18:31:27

标签: java

我使用ProGAL找到三个球体的两个交叉点。

这是我的代码:

Point p0 = new Point(2,8,1);
Point p1 = new Point(5,9,17);
Point p2 = new Point(21,19,11);
Point p3 = new Point(7,4,1);
double r0 = p3.distance(p0);
double r1 = p3.distance(p1);
double r2 = p3.distance(p2);
Sphere s0 = new Sphere(p0, r0);
Sphere s1 = new Sphere(p1, r1);
Sphere s2 = new Sphere(p2, r2);
Point[] intersections = Sphere.getIntersections(s0, s1, s2);
for(Point point : intersections)
    System.out.println(point.x() + " " + point.y() + " " + point.z());

这是输出:

8.748195083271948 1.1144249830330588 0.8525618604469422
-6.949424320444698 27.02495339639668 2.176457472808587

这些点都不接近实际点(7,4,1)

是因为
i)舍入错误?
ii)算法错误?

iii)我做错了什么?

0 个答案:

没有答案