using System;
using Windows.UI.Input;

namespace PCUT.Extensions
{
    public static class ManipulationExtensions
    {
        public static (double OffsetX, double OffsetY) CalculateTranslation(this ManipulationDelta d, ManipulationVelocities v)
        {
            var vx_factor = Math.Max(v.Linear.X * v.Linear.X, 1);
            var vy_factor = Math.Max(v.Linear.Y * v.Linear.Y, 1);
            return (d.Translation.X * vx_factor, d.Translation.Y * vy_factor);
        }
    }
}
