Memorizing math equations

So I’ve always been pretty bad at math or actually just haven’t done much math in the past but have been scripting for 3 years and I know how to do the majority of what I want but when it comes to stuff like Bezier Curves etc… I can’t really wrap my head around it and don’t feel super competent since I can’t memorize it either. Do any of you actually feel the need to memorize equations like I have below and or do you know them off the top of your head or would you say it’s normal even for very successful devs to have to use already made equations and just implement them into their game?

function B(t,p0,p1,p2,p3)
	return (1 - t)^3*p0 + 3*(1 - t)^2*t*p1 + 3*(1 - t)*t^2*p2 + t^3*p3
end

No one memorizes these equations. Just like no one memorizes everything in every library. Documentation exists for a reason, don’t be afraid to use it

2 Likes

Maybe it’s just my pride or something but using already made equations like above to make say a bezier curve with the only work I put in is filling in the parameters and loop a part along what’s returned or something feels like cheap and makes me feel like I don’t understand my game like other people do.

Especially when I don’t understand the math behind it.

1 Like

Understanding stuff can be important, but you shouldn’t worry about memorizing everything you learn.

1 Like

You’re wrong here. Not many “memorize” full equations like this, but some do. Realistically wouldn’t even be hard. If you make it to any course using calculus, you can learn the full power of memorizing 100 trig rules.

On the topic of “every library”. You are certainly wrong here. If you use a language a lot, you will come to just know every part of the native libraries.

What realistically you should be doing is trying derive this yourself without having to refer to documentation or “memorize” things. If you actually understand how the “formula” works and how applying it in series does, then you won’t need to “memorize” anything, or refer to documentation, because it will just make sense. Too many people get caught up on “formulas” without understanding what they are using.

Consider the base case: linear interpolation. You wish to translate a to b, where t is the proportion from a to b.

x + (b - a) * t

Reading this, you have the original value, a, then you are adding the difference from b to a, but first you multiply your alpha (t) to get the proportion you wish to interpolate to.

Logically this just makes sense. To get to b from a you just add (b - a) to a. So to get to some proportion from a that tends towards b, you would just multiply some value t by the difference from a.

4 Likes

What about the individual(s) that formulated these equations and the programmer(s) who created all of those libraries?

This is very complicated for a human brain to memorize this math equation. Even for a decent memory like me. The max I can memorize is a simple GUI collision system.

If you simplify it, you might memorize it

It fully seems like a waste of time and effort to memorizing every library and how it works behind the scenes instead of just learning how to use it and what it outputs for you in game dev, I feel like if I spent my time learning behind the scenes of everything I would be releasing games about 8 years apart or longer.

just make it into a modulescript. as you can load it anytime and. they exist

bezier curves atleast with quadratic form is essentially just say you got points A,B,C
local val1 = lerp(A,B)
local val2 = lerp(B,C)
return lerp(val1, val2)

and one way to describe linear interpolation, atleast in the roblox example is in a vectors parametric (think like parameter) form, that being

(1-t)*a+tb

so just do that logic with the above code and you get

(1-t)*(1-t)*a+tb+t*(1-t)*b+tc

which simplifies to (and notice this is the same as the roblox one)

a*t^2−2*bt*^2+c*t^2−2*a*t+2*b*t+a

now you could also just write the interpolation in a more intuitive way with

a+(b-a)*t

then it would just be

a*t^2−2*bt*^2+c*t^2−2*a*t+2*b*t+a

which also just gives the exact same

now all a cubic bezier curve is, which is what you showed is

local val1 = lerp(A,B)
local val2 = lerp(B,C)
local val3 = lerp(C,D)
local val4 = lerp(val1,val2)
local val5 = lerp(val2,val3)
return lerp(val4,val5)

so just plug in that a+(b-a)*t stuff into them and you get

−a*t^3+3*b*t^3−3*c*t^3+d*t*3+3*a*t^2−6*b*t^2+3*c*t^2−3*a*t+3*b*t+a

wow, okay I can see why they parameterize their equations now, jesus those binomial expansions look scary.