public static Cuaternion normalizar(Cuaternion Q) { float d = Q.modulo(); if (d > 0) { Q.a = Q.A / d; Q.x = Q.X / d; Q.y = Q.Y / d; Q.z = Q.Z / d; } return(new Cuaternion(Q)); }
public static Cuaternion quater_inverso(Cuaternion Q) { float d = Q.modulo(); if (d > 0) { Q.a = Q.A; Q.x = (-1) * Q.X; Q.y = (-1) * Q.Y; Q.z = (-1) * Q.Z; } return(new Cuaternion(Convert.ToSingle(Q.A / (Math.Pow(d, 2))), Convert.ToSingle(Q.x / (Math.Pow(d, 2))), Convert.ToSingle(Q.y / (Math.Pow(d, 2))), Convert.ToSingle(Q.z / (Math.Pow(d, 2))))); }