public static Matrix3F GetArbitraryCoordSystem(Vector3F zaxis) { Vector3F xaxis; if ((double)System.Math.Abs(zaxis.X) > (double)System.Math.Abs(zaxis.Y)) { double num = 1.0 / System.Math.Sqrt((double)zaxis.X * (double)zaxis.X + (double)zaxis.Z * (double)zaxis.Z); xaxis = new Vector3F((float)(-(double)zaxis.Z * num), 0.0f, zaxis.X * (float)num); } else { double num = 1.0 / System.Math.Sqrt((double)zaxis.Y * (double)zaxis.Y + (double)zaxis.Z * (double)zaxis.Z); xaxis = new Vector3F(0.0f, zaxis.Z * (float)num, (float)(-(double)zaxis.Y * num)); } return(Transformation3F.smethod_0(xaxis, zaxis)); }
public static Matrix3F GetCoordSystem(Vector2F xaxis) { Vector2F yaxis = new Vector2F(xaxis.Y, -xaxis.X); return(Transformation3F.GetCoordSystem(xaxis, yaxis)); }
private static Matrix3F smethod_0(Vector3F xaxis, Vector3F zaxis) { Vector3F yaxis = Vector3F.CrossProduct(zaxis, xaxis); return(Transformation3F.GetCoordSystem(xaxis, yaxis, zaxis)); }