I'm writing some geometry code using System.Numerics and I seem to have encountered a bug in the implementation of the Plane.CreateFromVertices
method. The comment on Plane.D
says:
The plane's distance from the origin along its normal vector.
However if I call this with three vertices at Y = 0.5 I get the plane:
N = (0, 1, 0)
D = -0.5
The D is negative! So as far as I can see either the comment is wrong, and D should be labelled:
The distance of the origin from the plane along the normal vector
or Plane.CreateFromVertices
is wrong, and D should be positive.
Am I correct (in which case I shall go write a bug report), or am I misunderstanding something here (in which case, what and why?).