Hi guys,
I noticed something very annoying… and I want to know if its a bug, or if there is some kind of mathematical logic behind such behavior.
When I construct a Plane given an origin point and two vectors, I get waaaay more decimal points than I need, thus producing some erroneous rounding that is making my code not work as expected.
below some code that explains this:
double a = Math.Round(0.981179, 2);// a = 0.98
double b = Math.Round(-0.193102, 2);// b = -0.19
double c = Math.Round(0.951179, 2); // c = 0.95
double d = Math.Round(-0.173102, 2);// d = -0.17
Vector3d xAxis = new Vector3d(a, b, 0);// xAxis = {0.98,-0.19,0}
Vector3d yAxis = new Vector3d(c, d, 0);//yAxis = {0.95,-0.17,0}
Plane plane = new Plane(Point3d.Origin, xAxis, yAxis);
A = plane.XAxis; // {0.98172,-0.190333,0} ???? Why??
// I am expecting it to be {0.98, -0.19,0}
@DavidRutten, @dale , @piac do you guys know why this is happening??
any help here would be great !!