/// <summary> /// Applies the inverse of this transformation to the given transformation. /// </summary> /// <param name="other"></param> public Transform2d ApplyInverse(Transform2d 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 Transform2d Apply(Transform2d other) { other.Rotation = Rotation.Apply(other.Rotation); other.Translation = Apply(other.Translation); other.Scale *= Scale; return(other); }
/// <summary> /// Creates a relative transformation from t0 to t1. /// </summary> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> public static Transform2d CreateFromTo(Transform2d from, Transform2d to) { return(to.Apply(from.Inverse)); }
/// <summary> /// Creates a relative transformation from t0 to t1. /// </summary> /// <param name="t0"></param> /// <param name="t1"></param> /// <returns></returns> public static Transform2d CreateRelative(Transform2d t0, Transform2d t1) { return(t1.Apply(t0.Inverse)); }
/// <summary> /// /// </summary> /// <param name="t0"></param> /// <param name="t1"></param> public static Transform2d Multiply(Transform2d t0, Transform2d t1) { return(t0.Apply(t1)); }
/// <summary> /// /// </summary> /// <param name="transform"></param> /// <param name="point"></param> /// <returns></returns> public static Vec2d Multiply(Transform2d transform, Vec2d point) { return(transform.Apply(point)); }