(Known as a stadium, it's basically a 2D capsule.)
I need a formula to draw this shape on a graph, preferably in that orientation (on its side).
What I've tried:
I've tried adapting the formula for a capsule from 3D to 2D, but to no avail, I'm only able to produce a circle from it. So not really sure how to approach this problem as I've not tried mapping any shape like this to a function before.
Context:
Not sure how relevant this is to the question, but I'm experimenting with different camera speed-up and slow-down functions for an RTS game I'm making, and in order to tell the camera how to move, I'm trying different functions to map its speed (y axis) with time (x axis), as it is told to move or ceases being told to move. One such method I want to try is, if you divide the stadium shape into 6 sections, one section being the top left curve part, another being the bottom left curve part, another being the top middle part, etc, mapping the top left curve part followed by the top middle part as the speed time graph of the camera for acceleration, and the top middle part and the top right part for deceleration, which I could achieve by taking the magnitude of the formula to remove the bottom half.
I could also just use the equation for a circle and isolate the top left, and once it reaches the peak just keep it at that value until the input is let go of, and then switch to the top right, but in searching for the stadium formula I found that it doesn't seem to be anywhere online, therefore this question would likely be useful to others searching for it.