public static Matrix4d buildXRotation(float angle) { Matrix4d m = new Matrix4d(); m.rotX(angle); return(m); }
public static Matrix4d buildCanonicalOrientationEuclidean(Point4d a, Point4d b) { Point4d orientation = new Point4d(b.x - a.x, b.y - a.y, b.z - a.z); //float r = Mathf.Sqrt(orientation.x * orientation.x + orientation.y * orientation.y + orientation.z * orientation.z); float theta = Mathf.Atan(orientation.y / orientation.x); float phi = Mathf.Atan(Mathf.Sqrt(orientation.x * orientation.x + orientation.y * orientation.y) / orientation.z); Matrix4d rotationMat = new Matrix4d(); rotationMat.rotX(theta); Matrix4d rotationMatResult = new Matrix4d(); rotationMatResult.rotZ(phi); rotationMatResult *= rotationMat; return(rotationMatResult); //TODO: implement }