Best way to do high level math? (Calculus and Linear Algebra)

I occasionally run into a few situations where it would be great to be able to do some advanced calculus, specifically in projectile motion. One particular use case is using the velocity vector to find the displacement and acceleration vectors that goes with it. On paper, this is quite easy by just taking the derivative or integral of a vector valued function, yet to my knowledge, roblox lacks the API to do anything close to this.

Going even further, I’d love to be able to use matrices with rref, and eigenvalues to aid in solving differential equations for similar situations…

Is there an easy way to do complex math in Lua? Only way I could think of right now is to create our own functions to do it, yet that seems time intensive for something that should be simple. For matrices I guess we could break it down into a linear combination but that still seems rather time intensive.

Do you actually need Symbolic Math, like matlab / maple? Otherwise you have to work out any integrals or derivatives before writing your code. For projectile motion this is always possible if you have enough of the variables known.

Not necessary symbolic math, but being able to do certain operations inside of lua would be extremely helpful… Obviously with projectile motion, I can just use kinematic equations, but I would still like to be able to use vector valued functions for some of those things… I genuinely did not even think about working everything out before hand… How would that work with stuff like double or triple integrals where a indefinite form really just isn’t possible?

You can do vector valued functions, you write it exactly like you would normally. Vector3 has its + - and * operations defined with other vectors and with scalars.

1 Like