> computed the location of each Voronoi vertex by solving a 4 X 4
> linear system with a solver from LAPACK. For the life of me, I
> can't figure what you used to solve for the Voronoi vertices
To find the location of the center of a voronoi tetrahedron,
you have to find the center of a sphere through the four
vertices of the tetrahedron (A, B, C, D).
The coordinates (x,y,z) of that point P are such that:
AP = BP = CP = DP = radius of the sphere
or in coordinate form:
(a[0] - x)^2 + (a[1] - y)^2 + (a[2] - z)^2 =
(b[0] - x)^2 + (b[1] - y)^2 + (b[2] - z)^2 =
(c[0] - x)^2 + (c[1] - y)^2 + (c[2] - z)^2 =
(d[0] - x)^2 + (d[1] - y)^2 + (d[2] - z)^2
These equations can be rewritten pairwise, in terms of x, y, z.
taking the first and second lines above and solving yields:
(2a[0]-2b[0])*x + (2a[1]-2b[1])*y + (2a[2]-2b[2])*z =
= a[0]^2 + a[1]^2 + a[2]^2 - b[0]^2 - b[1]^2 - b[2]^2
You get 3 such equations that you can simplify and solve using LAPACK.
Looking at my code, the equation that i solve with LAPACK seems to be:
Ax = b
where A is the 4x4 matrix:
2a[0] 2a[1] 2a[2] -1
2b[0] 2b[1] 2b[2] -1
2c[0] 2c[1] 2c[2] -1
2d[0] 2d[1] 2d[2] -1
and b is the vector:
a[0]^2 + a[1]^2 + a[2]^2
b[0]^2 + b[1]^2 + b[2]^2
c[0]^2 + c[1]^2 + c[2]^2
d[0]^2 + d[1]^2 + d[2]^2
Please let me know if this is in the lines of what you're looking for.
Good luck on your project :o)
-manolis