I'm trying to rotate a point around the origin but i'm not sure what exactly i'm doing wrong, i'm using the built in System.Windows.Media.Media3D Namespace in PresentationCore:
var id = Matrix3D.Identity;
id.Rotate(new Quaternion(new Vector3D(1,0,0),90)); // Rotate around the X axis 90 degrees
var pt = new Point3D(0,0,10);
var p2 = id.Transform(pt); // Expect point to be rotated around the X axis 90 degree
Expected value of p2 is x:0; y:10; z:0;
Actual value is x:0; y:-10; z:2,22044604925031E-15
I'm sure i'm making a really basic error but i can't spot it.
(This answer assumes you are using and is using european notation of comma (,) instead of point (.))
You are getting the correct answer. 2,22044604925031 * 10^-15 is such a small number it is practically zero, but with round off error.
It is equal to about: 0,0000000000000022, close enough to 0 for most practical purposes.