A lot of math functions are now library functions. People try to no re-invent the wheel as mentioned previously.
What you need to learn is how to find and use these functions and subroutines. I've never used code academy so I am not aware of the content but I suspect it can be helpful.
My kids took programming in High school with grade 10 math. They did fine with it and had some cool examples. My daughter even created a rather basic video game. I'm not try to brag, but that should give you an idea of the prerequisites in order to be able to code something.
Also you are doing this to learn, so as long as you are persistent and somewhat enjoy it who cares if you make mistakes along the way, you probably will learn more from those then getting it right anyways.
My opinion of programming is that you get good at it by doing it.