Fourier Analysis For The Rest Of Us

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi everyone so as I stated in my last video the goal of this video is to show you how you can take an arbitrary path and approximate it with increasing amounts of circular motion which winds up being something that has immense practical applications I think as well as a lot of artistic ones too so first I'm gonna say sorry for the slight delay in putting out this video unfortunately I had some issues with corrupt video files so I had to do a lot of rear according so you might have to forgive some inconsistencies in video quality and wardrobe now this video is divided into three parts the first part contains all of the mathematical prerequisites that you need and I tried to keep this portion of the video at the level of a student who might be at the end of their high school career so if you've seen integrals complex numbers and maybe a dot product in your life I think you should be okay the second part of the video shows how you can use the infrastructure of vector graphics on your computer to take an arbitrary path that you might draw and convert it into a set of equations that you can use and the third part goes over how you might actually go about programming this so I do want to mention that this is an incredibly technical video and if that's not your cup of tea I hope you can check out some of my other videos or maybe join me next time where I'll be doing a video about philosophy which I'm very excited about so the goal here is to talk about all of the mathematical prerequisites you need to do this so let's start out with a path on the plane let me just draw a plane and you know there's some crazy path you know it overlaps with itself it runs over itself occasionally and then it ends where it started so it I guess I should call it a closed loop but not just a path so one way you can think about this is as a function so you can think about this as you know there's some function f that map's an interval to this craziness in the plane and whenever I talk about paths the interval that they'll be mapping from is always going to be 0 to 2 pi this is to make things consistent and the 2 pi is there because it'll make some of my formulas later a lot easier though it doesn't you know you can you can do this math with whatever you want so so here you have a path it's defined by a function f which takes the interval from 0 to 2pi to the plain now one thing I want to say is that our we're gonna think about the plane interchangeably as either you know the two-dimensional Euclidean plane or as the complex plane so if you remember the x-axis can be thought of as the real axis the y-axis can be thought of as the imaginary axis and if you think about this picture that way what F is doing is its assigning the interval so it's assigning every point in the interval to a complex number so another thing that I definitely want to mention is that I want my loops or my pads to be nice I don't want them jumping around discontinuously I don't want them oscillating violently I'm not being incredibly technical here but I guess if you can draw it with a marker your math will work out just fine there are things you can do that will cause all of this to break down but not stuff you run into like naturally on a day-to-day basis anyways the goal here what is the goal I should say right now that my handwriting is not fantastic but I'm just gonna say loudly and proudly everything I write down and hopefully that alleviates the issue the goal here is to approximate F you know we have to think about can we write F approximately as the sum of circular pads so a good point to start is what is a circular path and how exactly do I add them so let's start there all right so what is a circular path well I can define infinitely many circular paths very easily so I'm gonna say V n where n is an integer is defined by the formula T maps to e to the N I T so what is this well let's let's just run through a few examples what is V 1 well V 1 has the formula T maps to e to the I T which if you remember is the same thing as cosine T plus I sine T which if you draw it out is just you start at 1 and you go around the circle I'm sorry you go around the origin once in a circle of radius 1 reasonable what is say V minus 2 well V minus 2 is T mapping to e to the negative 2i t you do that that's also the same as starting at 1 but this time you go around the origin clockwise at twice the speed I once again you have to recall that all of our functions map from an interval 0 to 2 pi one other one I want to point out very quickly is what is a run out of room here so what is V 0 well V 0 is T mapping to e to the 0 I T which is just e to the 0 which is just 1 so V 0 is the path that starts at 1 and just doesn't move it stays at one the entire time so you can modify these paths slightly by multiplying the equation by a complex number so let's think about what is I don't know what is one plus I root three times v1 so what is what is the path like what happens to the path if I multiply it by this complex number one plus I square root of three well just think about it for a second where is one plus I of square root of three well I mean there's no scale here but let's say it's somewhere over here this is one plus I square root of three then you have to remember what does multiplication by a complex number do and what it does is it scales by the magnitude of the complex number and it rotates by the argument of the complex number and so multiplying this with the equation of v1 what that does is that just makes your circles start here and go around the origin still counterclockwise in a circle once I hope that makes sense if this were instead v2 all right let's say let's say it were V minus two then you would start here just as before and then go around the origin clockwise in a circle twice and so that is the effect that multiplying one of these circular V is with a complex number now to get more complicated pads you can of course add everything we've constructed so far so you can think about things like what is v1 plus 0.2 I times V minus 3 plus PI over 20 V minus 7 plus 0.6 v8 you know you can think like what is that and what this does basically is it'll take v1 which is going around the circle counterclockwise once and to that it will upend this and to that it will upend this and to that it will upend that so you have sort of four circles now rotating simultaneously making a complicated path and I just realized now that I've written this down that I can't actually draw this so I'm just gonna throw in a quick animation so you can see what this particular path looks like now of course I don't want to just add random things together I want to approximate my original path f you know that that crazy thing that I drew at the beginning so the question then becomes okay I have these circular paths the V ends how do i scale each VN before adding them if I want to approximate F and there's a very simple formula like answer to this and I'm going to call what you have to scale VN by so the complex number that you have to multiply VN by a and there's a simple formula for a N and it is an equals 1 over 2 pi the integral from 0 to 2 pi F of T e to the negative I and T DT ok that's what the formula is this by the way is called the nth Fourier coefficient of a very very important object in mathematics and like I said what you can do is now you can you can make a list of these circular paths so you know you multiply a 0 by V 0 you do a minus 1 v minus 1 a 1 V 1 a 2 V 2 a minus 2 B minus 2 a 3 V 3 a minus 3b minus 3 and of course you know there's you know it starts at negative infinity and goes all the way to infinity so they're they're infinitely many circular paths here and the big amazing fact is let's say you start with this one just a 0 V 0 nothing much happening and then let's say you add three of them so these three and then you add five of them so these 5 and then you add seven of them 7 what will happen is as you add more and more of these this will get closer and closer to your original crazy path F now that is incredibly incredibly astonishing and of course the first question is why like how what like why would this work and I think a good way to approach that question at least initially is to start by asking why would anyone even guess this formula like why why did anyone even try to prove that this might work okay so the reason that what I told you just now was a very natural thing to guess would work is that it generalizes concepts intuitions and ideas that you're already familiar with in a finite dimensional setting so let's say you're working in two dimensions you know you're working in a two dimensional Euclidean space and you have a vector a to coordinate vector a a 1 a 2 and another one B b1 comma b2 you might remember is that you can compute an inner product or dot product of these two vectors so the inner product or some people might write dot product of a and B is the same thing as a 1 B 1 plus a 2 B 2 and if I were to write this with a summation let's say it's just the some AI bi where I goes from 1 to 2 it's a simple formula you've probably seen it before now this device has a lot of geometric content attached to it and it's incredibly incredibly useful so let's say we're in a situation where you have two vectors in two-dimensional space that both have length 1 and are at right angles to each other so you know my dad my two vectors they're at right angles to each other and they're both have like the one I'm a call one of them v1 and another one v2 now a lot of things work out very very quickly just by doing basic trigonometry number one because I just said v1 has a length of 1 and v2 has a length of 1 the first thing is that if you take the inner product of V 1 with the one you will get one the next thing similarly 4v2 actually if you take the inner product of V two would be two you get one now since V 1 and V 2 are right angles to each other another fun fact is that the inner product of V 1 and V 2 is 0 this is true for any two vectors that are at right angles to each other this is actually a very easy way to test whether or not two vectors are at right angles to each other you can check their inner product and see if you get 0 these two are actually equivalent by the way so if you want to test whether or not you have two vectors that both have a length of 1 and are at right angles to each other you can just check these three formulas it's it they have AI they contain identical information but there's actually more because if I take another vector somewhere over here W it doesn't matter what W is it turns out it's very easy to decompose W as a linear combination of V 1 and V 2 so it just so happens that W no matter what W is in this situation W is always going to be the inner product of W with V 1 V 1 plus the inner product of W with V 2 V 2 if you've never seen this before I definitely encourage you to think about it or if you're lazy just look it up on Wikipedia so when you have two vectors like this it's incredibly easy to decompose any vector lying out there as a linear combination of the two it's very easy to figure out what these coefficients are now what I'm going to try and convince you is that what's happening here where that formula came from for the Fourier coefficients that I just told you about is just an infinite dimensional generalization of this very simple picture that we already have in two dimensions so let me just put the infinite dimensional picture right here okay so instead of two vectors let's say I have two pads P and Q so I don't know P looks like some crazy business Q looks like its own crazy business they're both paths now I can define an inner product of P and Q now when I define an inner product in the finite dimensional case I just sum the product of the coordinates but since now we're dealing with the infinite objects here the natural thing to try is to do an integral and since these paths are from 0 to 2pi a good generalization of this inner product is going to be let's just integrate the product from 0 to 2pi so PT QT DT we are very close to done however because we're working with complex numbers the math just doesn't quite work perfectly so I have to add a little complex conjugate right here and I also have to scale otherwise everything when we when we compute our formulas everything will just be scaled up slightly so I want to multiply 1 over 2 pi here so what you do is you just follow your nose and just generalize the formula for the inner product in the infinite dimensional case and let's just see what happens now immediately one thing you'll notice is that just like this case when you have two vectors that both have a length of 1 and are at a right angle to each other our V is those paths I defined earlier the e to the I T to the 2i T whatever you notice that if you take the inner product of V n with V n using this formula you will get 1 always also you'll notice that if you take the inner product of VK with V L where K is not equal to L you will always get 0 so it seems like all of those paths all the VIS that I made all seem to be at right angles to each other in infinite dimensional space just like these are at right angles to each other now all this would be you know like it like a theoretical curiosity like what does it mean to take an angle in infinite dimensional space like well like what is this nonsense you would be justified in arguing that this is all you know malarkey if this next formula also didn't generalize but of course it does now if you recall what we said earlier is that f you can approximate it as a sum of circular paths if you just look at go start adding all the way from negative infinity and you get to a minus 3 v minus 3 a3 b3 and so on so what we said earlier is that you can approximate F as a sum of circular paths by just two looking at larger and larger sections of this crazy infinite sum now what I want you to notice is that these AIS are precisely like if you remember what what what are these ands each a.m. is 1 over 2 pi the integral 0 to 2 pi F T e to the negative I NT DT which is precisely the inner product of F with V n if you just look at the formula previously this is precisely what that is so what the sum actually is is so this is the same as this which as you can see is a direct infinite-dimensional generalization of the formula that I stated worked in two dimensions which is why this is an obvious guess that you would naturally make for how to do this but of course the miraculous thing is that this very obvious guess actually produces usable approximations so I hope that made sense but of course there are so many so many details that I am suppressing here for example how do you prove that this actually works do you actually really mean all of these can you really take limits for these sums I mean there's just so many so many technical details that I'm ignoring but if you're curious about them and maybe if you're at the level of maybe like a first-year college student I would HIGHLY highly recommend this book so I'm putting it on the screen now so this is Stein and Shekhar cheese introduction to fourier analysis I read this maybe like seven or eight years ago and it contains all of the details that I ignored and what I feel is like an easy understandable way so this is my book recommendation in case you want to dig into this further but I think time has come for us now to dive into the practical aspects of actually implementing this all right so what we want to do to begin with is to take an image and extract a set of equations out of it now my plan to do this was to utilize as much existing infrastructure like I already had on my computer as possible so one thing you'll notice about this image that I drew for the previous video is that if i zoom into it let me recenter it then there's no loss of quality and as I'm sure a lot of you may have already guessed that's because this image is saved in what's called a vector graphics format now what is a vector graphics format so most of image formats that you encounter on a day to day basis so you know like PNG or jpg or whatever um the way they work is they save information about how each pixel should be colored and the issue with that is well you know most of the time it works out great but the issue with that is if you want to zoom in very far then you basically run out of information and everything starts to look incredibly you know chunky and blocky however what vector graphics the way vector graphics work is instead of saving information about how each pixel should be colored it saves information about how the image should be drawn so if you open a vector graphics file in like a text editor you'll see instructions on how to draw the image so for instance if you look at this little section on top of the S over here I know that the way the computer is seeing that is as a set of numbers that it can use to construct a bunch of quadratic equations and interpolate between them and like I said since the computer since the infrastructure to do that already exists on the computer it seemed to me the easiest way to accomplish this task is to just to make an image in a vector graphics format save it on the computer and just read the numbers off and reconstruct the equations from there I wanted to show this whole process from start to finish so I'm going to draw something and the program I'm using to draw my vector graphic is a dope animate you can also use illustrator and if you want a free option I've used Inkscape before and it works quite well if you want to be really lazy about you can also you know just type in something space SVG into Google and it'll you'll probably hit something so if you type in like Apple SVG you'll find someone has already made a vector graphic of an apple and you can just use that if you like so I'm going to start by a I don't know maybe I guess I'll make a leaf you all right so there it is I'm aware that I'm not van Gogh but I wanted to make something quick and dirty and I think this should work so the first thing I want to check and make sure is that the outline of the shape is a single unbroken path which it it seems to be all right so what I'm gonna do next is save this as a vector graphics file alright so now that I have saved my drawing as an SVG you can open it in a browser and see once again zooming in causes no loss of detail and you have a beautiful well I mean it's not exactly a beautiful drawing but I mean it looks okay so I just remember that the process that I'm about to show you works for any drawing that you might draw so it does not have to be this weird-looking so the next day I'm gonna do is I'm gonna open the SVG in a text editor just so you can actually see the individual lists of instructions that your computer sees and then I'll explain what they mean exactly so let's do that so here is everything opened in a text editor I'm using atom but you can use whatever you want to get rid a notepad if you wanted to but it's nice to use a text editor that recognizes you know xml style files which is of course what this is you know if you look at this file and there's a path and it's the path that we want this is our entire leaf and to draw the path there's a list of instructions so you can see them mq lql so like M followed by two numbers Q followed by a bunch of numbers L followed by some numbers and so on so MQ lql all the way down so this is this full list is a you know is a set of instructions for how to draw the path and so each of these letters have a specific meaning and I should say that in a you know in your average SVG file you'll find a lot more letters than just M Q and L and if you're curious about what they all mean what you should do is you can look it up on the Internet I think Mozilla has very good documentation about how SVG's work but since our file only the only directives it has is MQ and L I'll just explain what those mean because those relevant to our purposes so I've translated the first two two instructions from here into plain English I'm gonna go over them and tell you what they mean so the first instruction M mean move - this is not that exciting so move to this point eight hundred and twenty eight hundred and seventy two point seven comma sixteen point one five written this down here this is not that exciting the next instruction is the more exciting one so instruction number two is draw a quadratic Bezier curve now what is a quadratic Bezier curve so quadratic Bezier curve is a parabola that is is governed by three points it's governed by an initial point a control point and a final point but before I explain what the Bezier curve is let me explain how to find these points in the file so the initial point is the point that you're already at so the point you just moved to so the initial point is eight hundred and seventy two point seven comma sixteen point one five and you can see I copied that here that is the initial point the control point is the next point that's listed next to the Q so in here and seventy two point three comma sixteen point five five you can see that here and the final point is the next point so eight hundred and seventy two point 4 comma 17.15 so I hope that makes sense now I should explain what a quadratic Bezier curve is I think a picture speaks louder than words here so it ok so this is just from the you know the Wikipedia article on Bezier curves as you can see the red parabola is the parabola that we're after and p0 is the initial point the point that you start with p1 is what's called the control point and p2 is the final point now let's let's actually just derive the equation for this parabola so you can use it I should mention that this a parabola starts at x 0 and ends at time 1 so at x 0 it's at p 0 and a time one it is at p2 to derive an equation for this what you have to do is notice that there's a green point here you can see it that starts at p 0 and ends at p 1 at time 1 so at time 0 it's a p 0 and a time 1 it ends at p 1 let's first write down the equation for that point and once again remember that p 0 is our initial point p 1 is our control point and P 2 is our final point so what is the equation for the point that starts at time 0 at the initial point and ends at time 1 at the control point well let's just write it here so let's just do one minus T initial plus T times the control as you can check that if you plug 0 into this equation you'll get the initial point and if you plug 1 into this equation you will get the control point and the intermediate T's will give you intermediate points so this is the equation for this path we're to come up the path that starts at p 0 and ends at p 1 similarly there's another Green Point that starts at the control point and ends at the final point at at time 1 so I hope that makes sense so what's the equation for this point well it's 1 minus T times the control point plus T time times the final point I hope that makes sense now what is the equation for the point that travels between the two green points from time 0 to time one after all that is the black point that we're after that is the point that is drawing our parabola so like once again it is the point that starts at the first green point at time zero and ends at the final green point at time one well that is a simple equation too so same way 1 minus T times the equation for the first green point plus T times the equation for the final grade point I had not intended to do this derivation I just got excited but I hope that made sense and if it did not make sense because I guess it was a little slapdash just look at the equation it's on Wikipedia just look up quadratic Bezier curve or bezier curve in general and you'll find this equation on wikipedia it's and then you can take your time to figure it out if you like so anyways these instructions what they're telling you so instruction 1 is moved to eight hundred and seventy two point seven sixteen point one five instruction two is draw a curve with this equation that I've written out now and instruction three is two so we haven't yet left this Q line so we were here right this is the last point that we looked at so instruction three is draw another quadratic distance so instruction three is a draw another quadratic Bezier curve so once again you start at the point you last you ended your last instruction on so we ended our last instruction on 872 point four and 17.15 and that's our initial point in this situation our control point is the next point over so eight hundred and seventy five point seven and sixty six point nine five and our final point in this situation is eight hundred and thirty point one and seventy one point six and just like that you keep drawing quadratic Bezier curves again and again until you reach the end of this line which is right here and then the next direction is L which you may have guessed is just draw a line and you draw a line from the point where you ended your last instruction so in this case three hundred and seventy point zero five three hundred fourteen point zero five and you end your line at three hundred seventy point zero five three or fourteen point one five and so on and you just keep doing this you just keep going down the list I hope this makes sense and once again if it doesn't this is documented in a million places across the internet how to read these files and once again Mozilla has good documentation for this and I'll put it in the description so you know you just go down this list and now you I mean from here you actually get a set of equations that you can use so the next step is to program a computer to do what we were doing by hand here so let's let's go to that step all right so I've opened my Mathematica file and this file is where this video will end so I'm just gonna write out all of my code and you can see it in action and I should say that I was kind of debating not including this part in the video in part because I don't I mean Mathematica is not a programming language a lot of people use and I didn't want anyone to feel like you know if their preferred language is JavaScript or Python or you know if they like MATLAB I don't want people to feel that you know they need Mathematica to do this you could program this on a graphing calculator you could do it on a potato if you wanted what matters is that you understand the concepts so the way I'm going to structure the rest of this video is I'm going to write a few lines of code I'm going to explain what they do and then write a few more and explain what they do and the code is going to be sort of very slapdash and hacky I don't want to get into you know the implementation of good Mathematica code that is not what this video is about so I'm just gonna try and do this as quickly as possible and make sure the concepts are as clear as I can possibly make them let's do this all right everyone so this is the first few lines of code the first step is to import the list of instructions so I just copied that list of instructions you know the MQ l's and so forth and I put it in a text file called raw leaf data and here you can see I've imported it actually let's take a look at that a text file that I just imported as one long string and so here it is and there are few things about the way that this is organized that make it super duper annoying and so I think some what this code actually does is it pre processes things a little bit to make this a lot nicer so the first thing you may have noticed is that it's weird having a bunch of numbers just too crammed next to each other when some of those numbers are x-coordinates and some of them are y-coordinates so it would be really nice if you know these pairs were actually organized as pairs another issue with this as you may have noticed that every single number is positive and that works very well for images but for the type of math that we want to be do it's more convenient to have all of these points sort of hovering around the or so one thing we need to do is or at least it's convenient to do you don't have to do it is to translate all of these points so that you know their ad you know their their center of mass is basically at the origin and then the third thing is that images have this really weird coordinate system where the origin is in the top left which means the x-axis works like you would expect like moving right is the same as increasing the x-value however the y-axis is backwards so increasing the y-value and an image actually pushes you down in the image and so we need to flip all our y-values you know we need to do a reflection just so just so that it makes sense to the computer and our math doesn't get all screwed up and those three things by the way are what this little section of code does so it does the you know moving everything so it's centered at the origin flipping the y-values and pairing the x and y coordinates now the next thing I want to mention is and actually you might remember this from earlier but in order to make this type of format super duper compact every instruction is assumed to start at the point where the previous instruction ended so for example if you look at line three here it just says line and there's a point which obviously you need more than one point to define a line and it's assumed that if you say line point what you'll do is you'll look back at the previous instruction look at the point that the previous instruction ended with and use that point to start the line and while this makes for very compact files it makes for very hard reading so one thing that I would like to do is sort of you know take when I do my reorganization I want to take the point that a previous instruction ended with copy it and paste it in the next instruction just so it's easier to read so now if you reorganize things this way this line is way easier to read it's just like okay line start here and there very simple and that little bit of reorganization for every single line is what this piece of code does um and then there are a few other minor things and once you do that bit of reorganization where you copy the end of the previous instruction into the next instruction you no longer need this first line and that's basically it I mean there's one final line of code that takes each individual line and splits it up into its components so for example if you look at line three here line three is instructing you to draw a bunch of quadratic Bezier curves and what this line of code does is it splits it up into the individual quadratic Bezier curves and stores and you know it stores all of this into a variable that i've called pieces let's actually take a look at pieces as you can see this is way more beautifully organized than this was it's so easy to read so okay start with a quadratic Bezier curve this is the initial point this is the control point this is the final point then another quadratic Bezier curve this is the initial point this is the control point this is the final point and so on so this is a line this is the initial point this is a final point so now that we are done with our reorganization and our set of instructions is very easy to read we can proceed further this next bit of code is I think pretty self-explanatory so I've defined the actual equations for a line or a quadratic Bezier curve and I'm just substituting that into my pieces so if you remember each piece contains it's like a quadratic piece will contain the initial point the control point and the final point and now I'm just putting in the actual equations for that and I've called the variable where all that is stored piece functions and I already done this so you can check there you go a list of equations which is exactly what we've been wanting this whole time one thing I want to say is that remember that in our space all our pads are defined on an interval from 0 to 2pi so you're gonna have to scale so you know there's like maybe you know they're like a hundred or so pieces to this and so you know you can divide your interval from zero to 2pi into 100 or so pieces and then each piece gets its each piece of the interval gets its own little function and so you just just scale appropriately when I originally did this I had a more complicated system where the scaling was based on the actual length the length of the curve so you would like if there was a quadratic Bezier curve I would compute its length and then the amount of time spent drawing that curve was proportional to the length of the curve which is something that you could try but I don't think you have to do it all right so this next section of code computes the individual Fourier coefficients and I have to say we're almost home so here you can see the formula for the individual Fourier coefficients so here you're integrate you're doing 1 over 2 pi times the integral of e to the negative I J X times a piece but then you got to add over all the individual pieces integrating them over their respective domains you know you add that all up you should get 2 you know like I guess the J's Fourier coefficient and as you can see I have J running from negative a thousand to a thousand so that's about two thousand Fourier coefficients and one thing I did is I wrote these two a file as I computed them just in case everything crashed and burned I would not have to start the computation over so here is that file so the way it's saved is it's saved in a bunch of pairs each on a new line and the first element of the pairs the index of the Fourier coefficient and the second element of the pair is the actual Fourier coefficient and then I imported that file back in and saved it as you know a list of Fourier coefficients one thing I did here that I did not do in the previous video is that I've sorted the Fourier coefficients based on how big they are and so that means in the final product when actually draw the epicycles the biggest one will be in the center and they'll get smaller as you go out and I believe that should make for a prettier picture but I have to say I'm not 100% sure so we'll have to see what happens I actually think this would be a good moment to do a sanity check so let's actually let's actually add up the partial sum so let's actually do e to the e to the I T times the I it's Fourier coefficient and just add it up and plot it all from 0 to 2pi and see if we get the original image back so you can think of this plot as you know what you should what you get at the end of rotating all of the epicycles but I'm not actually drawing any of the epicycles so let's yeah let's just see how it looks so let's do a parametric plot where T goes from 0 to 2pi and what am i plotting okay I got I got to add the eighth Fourier coefficient times e to the I T so let's see total what am i what am i adding okay so take over the free a coefficients C and Act so the I Fourier coefficient is the second element of the pair that's where this 2 is coming from and e to the I times the first element of the pair so that's the index times T okay that should do it oh oh one more thing so this total will return a complex number so I need to convert that into a pair of real numbers let me just do that real fast so the real part the imaginary part okay okay this should work nope very nice so now we know all this works all we have to do is draw this same plot more slowly actually showing the epicycles all right so this is the last few lines you compute the Centers of each of the epicycles circle centers as I've called it here by just adding just adding one after another more fourier coefficient times the appropriate e to the i t times some constant so you add one more and that gives you the next circle center and then you add another one that gives you the next circle center and that's basically what I've done here nothing too exciting here and then you just make the graphic so you draw circles at each of these circle centers that we've computed and you make a parametric plot the same one that I made earlier when I was doing my sanity check and I don't know I colored the background green I'm just hit enter here and this should work so let's see let's just test it so the graphic at let's say time one it's taken a second yeah I don't have failed by green try to pick a good color scheme and I hope okay that's not so bad so yeah that's what it looks so now you can see all the epicycles and you can see it slowly drawing let me show the same graphic at the very ends of time 2pi no that looks pretty good I'm gonna do min just a little bit just to see yeah not bad so you can see all 2000 circles here and you can see it finishing drawing so to actually just get the animation I just have to export each of these individual frames as an image and then I'm done so that actually worked out pretty well let's actually look at an animation here so I've exported about 10 seconds worth of frames here and at 30 frames per second that's 300 frames enjoy you all right thank you all so much for watching if you enjoyed that hit the like button and subscribe to the channel and follow me on Twitter peace
Info
Channel: GoldPlatedGoof
Views: 35,644
Rating: 4.9657021 out of 5
Keywords: goldplatedgoof, fourier analysis
Id: 2hfoX51f6sg
Channel Id: undefined
Length: 43min 3sec (2583 seconds)
Published: Sat Jan 06 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.