/// <summary> /// Creates a relative transformation from t0 to t1. /// </summary> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> public static Orient2d CreateFromTo(Orient2d from, Orient2d to) { return(to.Apply(from.Inverse)); }
/// <summary> /// /// </summary> /// <param name="scale"></param> /// <param name="orientation"></param> public Transform2d(Vec2d scale, Orient2d orientation) { Scale = scale; Rotation = orientation.Rotation; Translation = orientation.Translation; }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <param name="tolerance"></param> /// <returns></returns> public bool ApproxEquals(Orient2d other, double tolerance = SlurMath.ZeroTolerance) { return (Translation.ApproxEquals(other.Translation, tolerance) && Rotation.ApproxEquals(other.Rotation, tolerance)); }
/// <summary> /// Applies the inverse of this transformation to the given transformation. /// </summary> /// <param name="other"></param> public Orient2d ApplyInverse(Orient2d other) { other.Rotation = Rotation.ApplyInverse(other.Rotation); other.Translation = ApplyInverse(other.Translation); return(other); }
/// <summary> /// Creates a relative transformation from t0 to t1. /// </summary> /// <param name="t0"></param> /// <param name="t1"></param> /// <returns></returns> public static Orient2d CreateRelative(Orient2d t0, Orient2d t1) { return(t1.Apply(t0.Inverse)); }
/// <summary> /// /// </summary> /// <param name="t0"></param> /// <param name="t1"></param> /// <returns></returns> public static Orient2d Multiply(Orient2d t0, Orient2d t1) { return(t0.Apply(t1)); }
/// <summary> /// /// </summary> /// <param name="orient"></param> /// <param name="point"></param> /// <returns></returns> public static Vec2d Multiply(Orient2d orient, Vec2d point) { return(orient.Apply(point)); }