/// <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)); }
/// <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); }
/// <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); }
/// <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)); }
/// <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; }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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)); }
/// <summary> /// /// </summary> /// <param name="t0"></param> /// <param name="t1"></param> public static Transform3d Multiply(ref Transform3d t0, ref Transform3d t1) { return(t0.Apply(t1)); }
/// <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)); }
/// <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)); }
/// <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; }
/// <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; }