I'm trying to figure out how to express parabolic motion (for example: \$y = x^2\$) using delta time. I thought about deriving it using a differential like \$y' = \frac{1}{2}x\$ but that results in a straight line with a slope of \$\frac{1}{2}\$.
I'm not familiar with using delta time in this context, and I'm confused about the different methods (explicit Euler, implicit Euler, etc.). For reference, I can already write a linearly moving function like y = 2 * x using delta time in love2d. Note: I'm just using love2 is just an example. Anything can be used in the answer.
function love.load() screenWidth, screenHeight = love.graphics.getDimensions() circle = { x = screenWidth * 0.5, y = screenHeight * 0.5, radius = 10, dx = 100, dy = -200, } end function love.update(dt) circle.x = circle.x + circle.dx * dt circle.y = circle.y + circle.dy * dt if circle.x - circle.radius < 0 or circle.x + circle.radius > screenWidth then circle.dx = -circle.dx circle.dy = -circle.dy end circle.x = math.max(circle.radius, math.min(screenWidth - circle.radius, circle.x)) if circle.y - circle.radius < 0 or circle.y + circle.radius > screenHeight then circle.dx = -circle.dx circle.dy = -circle.dy end circle.y = math.max(circle.radius, math.min(screenHeight - circle.radius, circle.y)) end function love.draw() love.graphics.circle("fill", circle.x, circle.y, circle.radius) love.graphics.print(string.format("x: %.1f, y: %.1f", circle.x, circle.y), 10, 10) end I was able to create a parabolic motion by using a formula that calculates speed from acceleration, which I found frequently mentioned online.
However, I must admit that I wrote it purely by imitation, and it feels like it's only working by chance.
How can I create a parabolic motion, such as a trajectory following \$y = x^2\$, with the origin at the center of the screen? (For expressing on a computer, anything reasonably complex would be fine (for example, the screen center as the origin seems difficult), but that might make it hard to settle on a single answer. So, this time, I would like to see the code for the behavior of \$x^2\$ centered on the screen.)
A movement that draws lines similar to the image below 
The coordinates in a computer do not match those in mathematics (as the allmost computer uses the top-left corner as the origin), but adopting the mathematical view would likely result in more complex code (which could lead to a deeper understanding).
The code I attempted:
function love.load() screenWidth, screenHeight = love.graphics.getDimensions() circle = { x = screenWidth * 0.5, y = screenHeight * 0.5, radius = 10, dx = 100, dy = -200, } end function love.update(dt) yAcceleration = 9.8 circle.dy = circle.dy + yAcceleration circle.x = circle.x + circle.dx * dt circle.y = circle.y + circle.dy * dt if circle.x - circle.radius < 0 or circle.x + circle.radius > screenWidth then circle.dx = -circle.dx circle.dy = -circle.dy end circle.x = math.max(circle.radius, math.min(screenWidth - circle.radius, circle.x)) if circle.y - circle.radius < 0 or circle.y + circle.radius > screenHeight then circle.dx = -circle.dx circle.dy = -circle.dy end circle.y = math.max(circle.radius, math.min(screenHeight - circle.radius, circle.y)) end function love.draw() love.graphics.circle("fill", circle.x, circle.y, circle.radius) love.graphics.print(string.format("x: %.1f, y: %.1f", circle.x, circle.y), 10, 10) end When I reverse the sign of yAcceleration like circle.dy = circle.dy - yAcceleration, it brings us closer to the ideal (since the sign of the coordinates in mathematics is opposite...) The further the circle moves towards the center, the slower it seems to travel (the reason is not yet clear at this stage).
The width is narrower than I expected. When I tried adjusting the values to widen it (e.g., yAcceleration = 0.8), it shifted away from the center. The speed also seems slower than before I made the changes.