Thew
@Thew

So like, a Very Long Time Ago I made these cool swirly curves while working on aerobat vfx stuff

Conceptually it's really simple:
Imagine a car driving at a constant speed. As it drives, the steering wheel is turned left/right according to some function. In this case it's just a cosine wave, i.e. you just smoothly wobble the wheel back and forth. By simply changing how fast the steering wheel oscillates, and how far from the center it's allowed to turn, the path of the car plots these different curves.

This is really easy to plot over time in a game, or in a single for-loop. It's a basic Turtle Graphics situation [turtles are operated by steering wheels]

OKAY BUT


jckarter
@jckarter

I just happened to be thinking about a similar problem the other day: wouldn't it be nice to track an object's position precisely along a curve representing the ground, instead of losing precision to floating-point error or having to approximate the curve as line segments? What kinds of curve would we have to restrict ourselves to in order to be able to compute the Cartesian position given only the length of the object's travel along the curve?

If we have a turtle moving at a fixed velocity, and only its angle changes over time, then that means the curve of its travel must correspond to a complex integral z(t) = ∫ exp[i f(t)] dt, for some real function f(t) that indicates the angle of travel at time t. There aren't that many forms of exp[g(t)] that have closed-form integrals (unless you count the elliptic integral functions as closed form), pretty much only g(t) = k t, so that limits the possibilities for f(t) such that f(t) must either be in the form k t, or in some form that simplifies the exp away. That leaves the following options:


ireneista
@ireneista

old post, relevant to our interests, resharing so we don't lose it before we get a chance to read it. enjoy!



You must log in to comment.

in reply to @Thew's post:

turtles are so good, i had to do brownian motion for some fx and it was as easy as doing "accumulate angle / e^2", i guess thats why a lot of more advanced calculus is just PDEs (turtles in a trenchcoat) and system dynamics and stuff

OH MY GOD I MIGHT HAVE BEEN STUDYING ALMOST THE EXACT SAME PROBLEM RECENTLY. FM synthesis involves making waves which look like sin(at + sin(bt)). there's also no closed form solution, but apparently it is possible to take the fourier transform somehow because we know the fourier series

nah it's fine

actually since most of my time is spent on GPUs, rather than Euler Integration ("adding, in a loop") I typically prefer Monte Carlo Integration ("guessing several times")

tbh I have the exact opposite take lol

almost EVERYTHING you could ever want to calculate in the real world is probably an integral. It's one of the most fundamental concepts in existence. There are a billion things wrong with math education but ONE of them is the fact that it treats Calculus as Super Advanced Hardcore Math for Nerds when it's actually one of the most intuitive subjects in the whole field

You could (should!) teach 13 year olds about integrals and derivatives. Integrals are literally just addition lol. Math education could be "hey you want to draw cool swirly shapes? want to know how a gyroscope works?" but instead only a subset of nerds over 18 get to learn math that makes sense while meanwhile Literally Everyone is forced to memorize the fucking quadratic formula for no reason

integrals are very much not just addition. the amount of measure theory and analysis you need to make the notion of an integral rigorous is kind of ludicrous, and none of it is intuitive unless you're deep into analysis hell. you can explain the idea behind integration to 13 year olds, but you're not going to be able to make anything you're talking about mathematically sound without giving them an entire math degree's worth of education.

basically the entirety of high school calculus is based on handwavy, non-rigorous notions of limits and measure, and it leads to integration and derivation being treated as magic symbol boxes rather than any real understanding of them, because engineers don't actually need any of the rigor and the US math education system was designed to pump out aerospace engineers in the mid 20th century.

also, integration is in general impossible to calculate. most functions which are integrable don't have closed-form expressions of their integrals, and actually calculating or reasoning about integrals is capital-h Hard

in reply to @ireneista's post: