Share via


lerp

 

I needed a quick function to return a point..

Spat

 public Point Lerp(Point p0, Point p1, double amtInterpolate)
    {

        double xlerp = p0.X + ( p1.X - p0.X ) * amtInterpolate;
        double ylerp = p0.Y + ( p1.Y - p0.Y ) * amtInterpolate;
        Point newPoint = new Point(xlerp, ylerp);
        return newPoint;
            
            
    }