Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="tolerance"></param>
 /// <returns></returns>
 public bool ApproxEquals(ref Transform3d other, double tolerance = SlurMath.ZeroTolerance)
 {
     return
         (Translation.ApproxEquals(other.Translation, tolerance) &&
          Rotation.ApproxEquals(ref other.Rotation, tolerance) &&
          Scale.ApproxEquals(other.Scale, tolerance));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d ApplyInverse(Transform3d other)
 {
     other.Rotation    = Rotation.ApplyInverse(other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
     other.Scale      /= Scale;
     return(other);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d Apply(Transform3d other)
 {
     other.Rotation    = Rotation.Apply(other.Rotation);
     other.Translation = Apply(other.Translation);
     other.Scale      *= Scale;
     return(other);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates relative transformation from t0 to t1.
 /// </summary>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <returns></returns>
 public static Transform3d CreateFromTo(ref Transform3d from, ref Transform3d to)
 {
     return(to.Apply(from.Inverse));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other, ref Transform3d result)
 {
     Rotation.ApplyInverse(ref other.Rotation, ref result.Rotation);
     result.Translation = ApplyInverse(other.Translation);
     result.Scale       = other.Scale / Scale;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other)
 {
     ApplyInverse(ref other, ref other);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d ApplyInverse(Transform3d other)
 {
     ApplyInverse(ref other, ref other);
     return(other);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Applies this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void Apply(ref Transform3d other)
 {
     Apply(ref other, ref other);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d Apply(Transform3d other)
 {
     Apply(ref other, ref other);
     return(other);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Creates relative transformation from t0 to t1.
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Transform3d CreateRelative(Transform3d t0, Transform3d t1)
 {
     return(CreateRelative(ref t0, ref t1));
 }
Exemplo n.º 11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 public static Transform3d Multiply(ref Transform3d t0, ref Transform3d t1)
 {
     return(t0.Apply(t1));
 }
Exemplo n.º 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="transform"></param>
 /// <param name="point"></param>
 /// <returns></returns>
 public static Vec3d Multiply(ref Transform3d transform, Vec3d point)
 {
     return(transform.Apply(point));
 }
Exemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Transform3d CreateRelative(ref Transform3d t0, ref Transform3d t1)
 {
     return(t1.Apply(t0.Inverse));
 }
Exemplo n.º 14
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other)
 {
     Rotation.ApplyInverse(ref other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
     other.Scale      /= Scale;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void Apply(ref Transform3d other)
 {
     Rotation.Apply(ref other.Rotation);
     other.Translation = Apply(other.Translation);
     other.Scale      *= Scale;
 }