Nice! The advantage of Cosine over Lagrange Interpolation is that new points can be added by only touching the last point and adding a cosine function to it.
bezier interpolation is hopelessly outdated and replaced by any displacement-map that uses much simpler interpolations (even gaussian blur quickly out-poerforms bezier-patches since fast enough memory got cheap enough in 2000s to store larger displacement-maps), or simply by doing FastFourierTransform (which is (more commonly) getting dedicated hardware accelleration to do FFT for video-like-communication between 2 processors) I do still see some good use cases for a triangular-patch of 3-quadratic-beziers==parabolas at the triangle-border, because that patch can still be traced analytically and efficiently with pixel-perfect precision AND it allows for decent curvature (quadratic patch has never more than 2 ray-intersections==roots, BUT allows for many "curved polygons", which is getting dedicated DXR-RTX hardware support)
That's actually a great interpolation for some kind of node editor, as in Blender, where you connect outputs to inputs on rectangular shapes (nodes). Looks best in such applications if lines end in a 90° angle to the box's border.
Beautiful Beautiful!!! Bezier interpolation, using things like Lerp() is also another beautiful way for a value x to approach another value y! It makes it smooth and i use it almost everywhere in UI design ( for example a text appearing form bottom to the center of the screen) ! Its great to see someone making such great vids! love ur vids
Hello, BigWIngs! Great video as usual, thank you so much! Can you please recommend any useful books on applied mathematics for programmers to continue exploring such a thing! Thank you!
Can you do a video on bezier curve as well? Not sure if it applies to 3d graphics a lot, but it is useful in some structural and graphic design at least.
Love this stuff, do you have any recommendations on books/channels/videos explaining how to model solids using math formulas? For example, if I had something like a bismuth crystal and knew its dimensions and I wanted to put together code that modeled that.
Ah, was about to request Bezier. Quadratic would be great too, it's often the nicest interpolation if you're moving objects or the camera. I'm still struggling with normalisation... I fully expected you to normalise the cosine to one by dividing by PI and yet the right answer was multiplication... I'm a bit tired now but I'll see if I can do this without referring to the video at some point. I'm pretty confident about the lerping, but the coserping - well maybe, let's see.
yeah, well it was in radians, so x goes from 0 to 3.14 to complete a half-cycle (pi radians). if you want x to go slower, you want the radians to dial less frequently, so you want x to complete a half-cycle from 0 to 6.28, for example. this means you'd want a half of x, as this would stretch the curve by a factor of 2. if you want x to go faster, you want the radians to dial more frequently as well, so for example x goes from 0 to 1.57. this means you'd want a double of x, as this would squish the curve by a factor of 2. because he wanted x to complete the half-cycle at 1 instead of 3.14, he decided to multiply x by pi.
@@milanstevic8424 Brilliant explanation, thank you so much. So when x is exactly 1, ordinarily this would be roughly a 6th of a complete cosine (as we saw) but if you multiply it by PI then 1 is precisely half a cosine wave. Obvious in hindsight. I just had it in my head that you divide by the scalar to normalise. Thank you once more, so helpful.
@@davidmurphy563 yep it's a little weird and non-intuitive because of the context. the inside of cos is with regard to some fixed interval, therefore about the frequency. if you double the whole output you intuitively *stretch* the curve along Y (amplitude), but by doubling the inner parameters you *squish* the curve along X (frequency). this inversion is where that confusion comes from, yet if you think only about the words 'amplitude' and 'frequency', they are both really doubled as expected.
@@davidmurphy563 btw, I forgot to mention this, but I would probably make this mistake myself, if that's any consolation. it's easy to think dividing by length would normalize it because this is normally the case with vectors.
@@milanstevic8424 That's precisely where I went wrong; thinking you divide vectors by the mag, therefore you should divide everything. I've written enough shaders messing with the sin/cos amp and freq you'd think I'd know what it does by now but aligning your intuitions with cold logic isn't always a given. I also got in a muddle on the normalisation working through the lagrangian interpolation as well and the channel owner (I can never catch his name properly and I don't want to get it wrong) kindly wrote an explanation setting me straight. It's frustrating because it's so obvious once the penny drops. But, you know, we're here to learn so any step forward is a win.
We're all in that boat until we work through it. Open desmos. Can you add a point? Can you make a straight line? Can you move that line? Can you place it under the point. And on you go. One step at a time, do it until you get stuck, watch the video again, try again. When you finally do it. Leave it a day and check you can still do it. It's all slog buddy but we can all get there.
@@syntax_error6882 this isn't particularly hard math, it's actually dead simple, but probably just looks intimidating. if you have any specific question, I'll be glad to answer.
@@milanstevic8424 my last answer was supress probably because i put a link on desmos.. anyway i manage to understand this video thanks to david for is simple advice cut in small step. i struggle with some detail like x-p1.x, but the linear algebra was pretty straightforward.. .and with a course on sin(x) and cos(x) the second part became clear. never believe this but its true, yersteday to me its was impossible .. anyway thanks to all and to art of code ..
Your teaching takes me into a mathematical world where the equations are as easy to manipulate as play doh! Thank you so much for sharing!
thanks a lot buddy, that you make this nerd wisdom accessible for all us mortals
"but first lemme just take a sip of tea"
*proceeds to grab a jug of tea*
this man is truly built different
Nice! The advantage of Cosine over Lagrange Interpolation is that new points can be added by only touching the last point and adding a cosine function to it.
Yes with Lagrange each added point affects the entire curve.
This was very helpful! I have used this to make smooth motions in the UI system I’m working on. Thanks a lot!
Excellent. I like the way you derive these from scratch, very cleverly done. I'd prefer quieter music, it's quite distracting
Music? I didn't even hear any :o
Great stuff! More interpolations, please, including Bezier.
bezier interpolation is hopelessly outdated and replaced by any displacement-map that uses much simpler interpolations (even gaussian blur quickly out-poerforms bezier-patches since fast enough memory got cheap enough in 2000s to store larger displacement-maps), or simply by doing FastFourierTransform (which is (more commonly) getting dedicated hardware accelleration to do FFT for video-like-communication between 2 processors)
I do still see some good use cases for a triangular-patch of 3-quadratic-beziers==parabolas at the triangle-border, because that patch can still be traced analytically and efficiently with pixel-perfect precision AND it allows for decent curvature (quadratic patch has never more than 2 ray-intersections==roots, BUT allows for many "curved polygons", which is getting dedicated DXR-RTX hardware support)
Great stuff! More interpolations, please! Newton interpolation, piecewise linear interpolation, Hermite interpolation, and cubic spline interpolation
Thanks! Piecewise linear you have here. Hermite I also have, check my video on smoothstep.
That's actually a great interpolation for some kind of node editor, as in Blender, where you connect outputs to inputs on rectangular shapes (nodes). Looks best in such applications if lines end in a 90° angle to the box's border.
Yes. I wouldn't be surprised if Blender uses exactly this
Beautiful Beautiful!!!
Bezier interpolation, using things like Lerp() is also another beautiful way for a value x to approach another value y! It makes it smooth and i use it almost everywhere in UI design ( for example a text appearing form bottom to the center of the screen) !
Its great to see someone making such great vids! love ur vids
Yes, beziers are great, I'll make a video about them. And for UI design, simple tweening functions are awesome as well.
@@TheArtofCodeIsCool thank you! I shall look more into the essence of tweening functions!
I love this series your doing, man! If I ever need a curvy line I'll know where to come back to
Ambient music is too loud
Noted
You would make such a great math teacher!
Great work
Great Work,Thank you
I love those videos!
Awesome! Thank you for video
that's very cool, didn't know about that
Man I love these videos!
I love these videos. Could you also look at the natural spline, where the second derivative is zero at the points. It has a really nice look to it.
Hello, BigWIngs! Great video as usual, thank you so much! Can you please recommend any useful books on applied mathematics for programmers to continue exploring such a thing! Thank you!
The only book on the topic I ever had was the first edition of this book: www.amazon.com/dp/1568817231/ref=cm_sw_r_awdo_navT_g_FCZ4C8G0NFYAWJVMH4VS
Nice thing about cosine interpolation is that to compute a given point on the curve you only need the two neighboring points.
Yes, unlike Lagrange
learning about these small things is really cool and I get to learn more really cool techniques at a good pace from you .w.
keep up the great work yo>
"let me take a sip of tea" takes out a 2 liter glass of tea 💀
Thanks a lot again ! :)
Thanks! Splines please and intersections with another curves and primitives!
Great videos! Thank you!
This is great but the music is very loud at the start.
I'm enjoying your shader stuff too. Subscribed
I am still waiting for bezier curve interpolation video!!! In DESMOS
do Bezier curves please !! great video as always !!
Great stuff !
Can you do a video on bezier curve as well? Not sure if it applies to 3d graphics a lot, but it is useful in some structural and graphic design at least.
Yes!!
Very nice. I'm wondering can this interpolation be implemented for surface in 3D?
👌
Can you do tutorial on quaternions and camera controls? :)
Love this stuff, do you have any recommendations on books/channels/videos explaining how to model solids using math formulas? For example, if I had something like a bismuth crystal and knew its dimensions and I wanted to put together code that modeled that.
I have many videos on how to make 3d effects. You could start with raymarching for dummies.
can you explain cubic interpolation please?
Ah, was about to request Bezier. Quadratic would be great too, it's often the nicest interpolation if you're moving objects or the camera.
I'm still struggling with normalisation... I fully expected you to normalise the cosine to one by dividing by PI and yet the right answer was multiplication... I'm a bit tired now but I'll see if I can do this without referring to the video at some point. I'm pretty confident about the lerping, but the coserping - well maybe, let's see.
yeah, well it was in radians, so x goes from 0 to 3.14 to complete a half-cycle (pi radians).
if you want x to go slower, you want the radians to dial less frequently, so you want x to complete a half-cycle from 0 to 6.28, for example.
this means you'd want a half of x, as this would stretch the curve by a factor of 2.
if you want x to go faster, you want the radians to dial more frequently as well, so for example x goes from 0 to 1.57.
this means you'd want a double of x, as this would squish the curve by a factor of 2.
because he wanted x to complete the half-cycle at 1 instead of 3.14, he decided to multiply x by pi.
@@milanstevic8424 Brilliant explanation, thank you so much. So when x is exactly 1, ordinarily this would be roughly a 6th of a complete cosine (as we saw) but if you multiply it by PI then 1 is precisely half a cosine wave.
Obvious in hindsight. I just had it in my head that you divide by the scalar to normalise. Thank you once more, so helpful.
@@davidmurphy563 yep it's a little weird and non-intuitive because of the context.
the inside of cos is with regard to some fixed interval, therefore about the frequency.
if you double the whole output you intuitively *stretch* the curve along Y (amplitude), but by doubling the inner parameters you *squish* the curve along X (frequency).
this inversion is where that confusion comes from, yet if you think only about the words 'amplitude' and 'frequency', they are both really doubled as expected.
@@davidmurphy563 btw, I forgot to mention this, but I would probably make this mistake myself, if that's any consolation. it's easy to think dividing by length would normalize it because this is normally the case with vectors.
@@milanstevic8424 That's precisely where I went wrong; thinking you divide vectors by the mag, therefore you should divide everything. I've written enough shaders messing with the sin/cos amp and freq you'd think I'd know what it does by now but aligning your intuitions with cold logic isn't always a given.
I also got in a muddle on the normalisation working through the lagrangian interpolation as well and the channel owner (I can never catch his name properly and I don't want to get it wrong) kindly wrote an explanation setting me straight. It's frustrating because it's so obvious once the penny drops. But, you know, we're here to learn so any step forward is a win.
Why didn't we use beizere curve?
Hey, what is your background? Are you mathematician?
I have worked in video games for most of my life. I have an interest in maths but I'm not a trained mathematician.
could be cool to show this in action with shader toy,
I will do something like this in ShaderToy soon I promise.
gj
Hahaa is it just me or is that real big?? 9:12
he was so slammed, he had to make a cut there xD
@@milanstevic8424 Hahahaa, nice!
What can I say, I like my tea. 😜
too bad I'm not at the level yet ..
We're all in that boat until we work through it. Open desmos. Can you add a point? Can you make a straight line? Can you move that line? Can you place it under the point. And on you go.
One step at a time, do it until you get stuck, watch the video again, try again. When you finally do it. Leave it a day and check you can still do it. It's all slog buddy but we can all get there.
@@davidmurphy563 wow it's heartwarming to read that !! thanks mat
@@syntax_error6882 this isn't particularly hard math, it's actually dead simple, but probably just looks intimidating. if you have any specific question, I'll be glad to answer.
@@milanstevic8424 my last answer was supress probably because i put a link on desmos..
anyway i manage to understand this video thanks to david for is simple advice cut in small step.
i struggle with some detail like x-p1.x, but the linear algebra was pretty straightforward.. .and with a course on sin(x) and cos(x) the second part became clear.
never believe this but its true, yersteday to me its was impossible ..
anyway thanks to all and to art of code ..