This sketch draws an oval as the user drags horizontally across the screen from right-to-left . But the oval starts and completes too quickly to match the feel of the mouse drag. I’d like to use easing to a) start out more gradually (like easeInOutSine), but also b) delay the end and finish more abruptly (like easeInQuart).

I’ve tried lerp()'ing from one function to the other (the third commented line), but it causes an awkward pause about halfway through, reconciling the big gap between the two functions. The gap is visible in the combined graphs below, and palpable if you un-comment it and try the drag. It feels like it gets stuck going uphill. ;(

Any help/suggestions greatly appreciated!

```
PVector mouseStart, topXY, bottomXY;
float mouseStopX;
float zWidth = 150; // width of zero
float zHeight = 250; // height of zero
public void setup() {
size(800, 600);
smooth();
strokeWeight(3);
fill(0);
textSize(42);
textAlign(CENTER);
text("Swipe left to draw a zero ('0')", width/2, 100);
}
public void draw() {
// drawn inside extendZeroSwipe (triggered from mouseDragged)
}
public void mouseReleased() {
mouseStart = null; // flag to start over
}
public void mouseDragged() {
if (mouseStart == null)
mouseStart = startZeroSwipe();
extendZeroSwipe(max(mouseX, mouseStopX));
}
public void extendZeroSwipe(float x) {
PVector nextTop = nextXY(x, 2 * PI, PI);
PVector nextBottom = nextXY(x, 0, PI);
line(topXY.x, topXY.y, nextTop.x, nextTop.y);
line(bottomXY.x, bottomXY.y, nextBottom.x, nextBottom.y);
topXY = nextTop;
bottomXY = nextBottom;
}
public PVector nextXY(float mouseX, float startRadians, float stopRadians) {
float progress = map(mouseX, mouseStart.x, mouseStopX, 0, 1);
//progress = -(cos(PI * progress) - 1) / 2; // easeInOutSine
//progress = pow(2, 10 * progress - 10); // easeInExpo
//progress = lerp(-(cos(PI * progress) - 1) / 2, pow(2, 10 * progress - 10), progress);
float radians = lerp(startRadians, stopRadians, progress);
float x = cos(radians) * zWidth + mouseStart.x;
float y = sin(radians) * zHeight + mouseStart.y;
return new PVector(x - zWidth, y);
}
public PVector startZeroSwipe() { // start/restart oval
background(204);
mouseStart = new PVector(mouseX, mouseY);
mouseStopX = mouseX - zWidth * 2;
topXY = nextXY(mouseStart.x, 2 * PI, PI);
bottomXY = nextXY(mouseStart.x, 0, PI);
return topXY;
}
```