public static __m33t__ Multiply(__rot2t__ rot, __m33t__ mat) { __ft__ a = (__ft__)System.Math.Cos(rot.Angle); __ft__ b = (__ft__)System.Math.Sin(rot.Angle); return(new __m33t__(a * mat.M00 + b * mat.M10, a * mat.M01 + b * mat.M11, a * mat.M02 + b * mat.M12, -b * mat.M00 + a * mat.M10, -b * mat.M01 + a * mat.M11, -b * mat.M02 + a * mat.M12, mat.M20, mat.M21, mat.M22)); }
public static __v2t__ Multiply(__rot2t__ rot, __v2t__ vec) { __ft__ a = (__ft__)System.Math.Cos(rot.Angle); __ft__ b = (__ft__)System.Math.Sin(rot.Angle); return(new __v2t__(a * vec.X + b * vec.Y, -b * vec.X + a * vec.Y)); }
public static __m34t__ Multiply(__rot2t__ rot, __shift3t__ shift) { __ft__ a = (__ft__)System.Math.Cos(rot.Angle); __ft__ b = (__ft__)System.Math.Sin(rot.Angle); return(new __m34t__(a, b, 0, a * shift.X + b * shift.Y, -b, a, 0, -b * shift.X + a * shift.Y, 0, 0, 1, shift.Z)); }
public static __v3t__ Multiply(__rot2t__ rot, __v3t__ vec) { __ft__ ca = (__ft__)System.Math.Cos(rot.Angle); __ft__ sa = (__ft__)System.Math.Sin(rot.Angle); return(new __v3t__(ca * vec.X + sa * vec.Y, -sa * vec.X + ca * vec.Y, vec.Z)); }
/// <summary> /// Checks if 2 objects are equal. /// </summary> /// <returns>True if equal.</returns> public override bool Equals(object obj) { if (obj is __rot2t__) { __rot2t__ rotation = (__rot2t__)obj; return(Angle == rotation.Angle); } return(false); }
public static __m33t__ Multiply(__rot2t__ rot, __scale3t__ scale) { __ft__ a = (__ft__)System.Math.Cos(rot.Angle); __ft__ b = (__ft__)System.Math.Sin(rot.Angle); return(new __m33t__(a * scale.X, b * scale.Y, 0, -b * scale.X, a * scale.Y, 0, 0, 0, scale.Z)); }
/// <summary> /// Adds 2 rotations. /// </summary> public static __rot2t__ Add(__rot2t__ r0, __rot2t__ r1) { return(new __rot2t__(r0.Angle + r1.Angle)); }
// [todo ISSUE 20090225 andi : andi] Wir sollten auch folgendes ber�cksichtigen -q == q, weil es die selbe rotation definiert. // [todo ISSUE 20090427 andi : andi] use an angle-tolerance // [todo ISSUE 20090427 andi : andi] add __rot3t__.ApproxEqual(__rot3t__ other); public static bool ApproxEqual(__rot2t__ r0, __rot2t__ r1, __ft__ tolerance) { return((r0.Angle - r1.Angle).Abs() <= tolerance); }
public static bool ApproxEqual(__rot2t__ r0, __rot2t__ r1) { return(ApproxEqual(r0, r1, Constant <__ft__> .PositiveTinyValue)); }
/// <summary> /// Transforms a position vector. /// </summary> public static __v2t__ InvTransformPos(__rot2t__ rot, __v2t__ v) { return((__m22t__)__rot2t__.Negate(rot) * v); }
/// <summary> /// Transforms a position vector. /// </summary> public static __v2t__ TransformPos(__rot2t__ rot, __v2t__ v) { return((__m22t__)rot * v); }
/// <summary> /// Subtracts 2 rotations. /// </summary> public static __rot2t__ Subtract(__rot2t__ r0, __rot2t__ r1) { return(new __rot2t__(r0.Angle - r1.Angle)); }
/// <summary> /// Multiplies 2 rotations. /// </summary> public static __rot2t__ Multiply(__rot2t__ r0, __rot2t__ r2) { return(new __rot2t__(r0.Angle * r2.Angle)); }
public static __m33t__ Multiply(__rot2t__ rot2, __rot3t__ rot3) { return(__rot2t__.Multiply(rot2, (__m33t__)rot3)); }
public static __m22t__ Multiply(__rot2t__ rot, __m22t__ mat) { return((__m22t__)rot * mat); }
/// <summary> /// Divides scalar by a rotation. /// </summary> public static __rot2t__ Divide(__rot2t__ rot, __ft__ val) { return(new __rot2t__(rot.Angle / val)); }
/// <summary> /// Adds scalar to a rotation. /// </summary> public static __rot2t__ Add(__rot2t__ rot, __ft__ val) { return(new __rot2t__(rot.Angle + val)); }
/// <summary> /// Negates rotation. /// </summary> public static __rot2t__ Negate(__rot2t__ rot) { return(new __rot2t__(-rot.Angle)); }
/// <summary> /// Subtracts rotation from a scalar. /// </summary> public static __rot2t__ Subtract(__ft__ angle, __rot2t__ rot) { return(new __rot2t__(angle - rot.Angle)); }
/// <summary> /// Multiplies scalar with a rotation. /// </summary> public static __rot2t__ Multiply(__rot2t__ rot, __ft__ val) { return(new __rot2t__(rot.Angle * val)); }