public Vector4f Rotate(Vector4f axis, float angle) { float sinAngle = (float)Math.Sin(-angle); float cosAngle = (float)Math.Cos(-angle); return(this.Cross(axis.Mul(sinAngle)).Add( //Rotation on local X (this.Mul(cosAngle)).Add( //Rotation on local Z axis.Mul(this.Dot(axis.Mul(1 - cosAngle)))))); //Rotation on local Y }
public Vector4f Rotate(Vector4f axis, float angle) { float sinAngle = (float)Math.Sin(-angle); float cosAngle = (float)Math.Cos(-angle); return this.Cross(axis.Mul(sinAngle)).Add( //Rotation on local X (this.Mul(cosAngle)).Add( //Rotation on local Z axis.Mul(this.Dot(axis.Mul(1 - cosAngle))))); //Rotation on local Y }