I have posted this question in Stack Overflow programming forum. Someone there feels it might be more suited to Mathematics.
I have to warn you I am rusty in math and was terrible in Algebra.
Using Accord Framework plane class. The help on this page specifies a constructor that creates a plane a certain distance from the origin. I am getting numbers that do not make sense. If I create a plane using the vector 5,5,5 at a distance of 1 then I would expect the plane to be 1 away from the origin:
Plane p = new Plane(new Vector3(5,5,5),1);
Console.WriteLine("{0}", p.DistanceToPoint(new Point3(0,0,0)));
Instead I get the value of 0.115470053837925.
The only way I get a distance that makes sense is to create a plane using one of the three constructors below:
Plane p = new Plane(new Vector3(0,0,1),1);
Plane p = new Plane(new Vector3(0,1,0),1);
Plane p = new Plane(new Vector3(1,0,0),1);
When using any of these constructors I get a distance of 1 from the origin.
What am I missing here?
Either the API or the documentation are wrong.
Regardless the other arguments, Offset is deemed to specify the distance from the plane to the origin, and DistanceToPoint should return the same value.
I strongly suspect that Offset is in reality the parameter d of the equation, and the normal vector is never normalized. Indeed,
$$5x+5y+5z+1=0$$
defines a plane at distance $\dfrac1{5\sqrt3}$ of the origin.
Try with