public void Set(AxisVector3F a) { x = a.x; y = a.y; z = a.z; angle = a.angle; }
public void Set(AxisVector3F a) { AxisVector3F aa = new AxisVector3F(a); if (aa.angle == 0) { aa.y = 1; } Set(new Matrix3X3F().Set(aa)); }
public override bool Equals(object o) { if (!(o is AxisVector3F)) { return(false); } AxisVector3F a1 = (AxisVector3F)o; return(x == a1.x && y == a1.y && z == a1.z && angle == a1.angle); }
public Matrix3X3F Set(AxisVector3F a) { double x = a.x; double y = a.y; double z = a.z; double angle = a.angle; // Taken from Rick's which is taken from Wertz. pg. 412 // Bug Fixed and changed into right-handed by hiranabe double n = Math.Sqrt(x * x + y * y + z * z); // zero-div may occur n = 1 / n; x *= n; y *= n; z *= n; double c = Math.Cos(angle); double s = Math.Sin(angle); double omc = 1.0 - c; m00 = (float)(c + x * x * omc); m11 = (float)(c + y * y * omc); m22 = (float)(c + z * z * omc); double tmp1 = x * y * omc; double tmp2 = z * s; m01 = (float)(tmp1 - tmp2); m10 = (float)(tmp1 + tmp2); tmp1 = x * z * omc; tmp2 = y * s; m02 = (float)(tmp1 + tmp2); m20 = (float)(tmp1 - tmp2); tmp1 = y * z * omc; tmp2 = x * s; m12 = (float)(tmp1 - tmp2); m21 = (float)(tmp1 + tmp2); return(this); }
public Quat(AxisVector3F a) { Set(a); }
protected bool Equals(AxisVector3F other) { return(x.Equals(other.x) && y.Equals(other.y) && z.Equals(other.z) && angle.Equals(other.angle)); }
public AxisVector3F(AxisVector3F a1) { Set(a1.x, a1.y, a1.z, a1.angle); }