Archived

This topic is now archived and is closed to further replies.

How important is Calculus in programming?

This topic is 5670 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For a lot of physics simulations it''s important/useful to understand calculus but it''s not important ot be able to do it. Calculus crops up all over games physics. E.g. the mechanics of the motion of the player ship in asteroids can be expressed using calculus. But such problems are rarely solved using calculus, i.e. by algebraic integration.

Instead such problems are solved by difference methods. The asteroids ship simply updates it''s velocity based on friciton/drag and any thrust, and this velocity is used to update the ship''s position, using something like

x = x + u * dt
y = y + v * dt

The velocity is not integrated algebraically to get the position as even in this simple example there''s no simple solution to this integration.

You need to understand the fundamentals of calculus to set up such simulations, but once you''ve set them it''s almost always easiest to use such ''numeric'' integration which is mathematically far simpler and quicker. You can sometimes use integration and differentiation to simply expressions, but many examples do not require this.

Share this post


Link to post
Share on other sites
Personally I would say it isn''t important for programming. Rather it is important for developing certain types of applications. I have to ask why you flunked calculus? Before you base some decision on having flunked calculus you need to understand why you flunked it. Particularly since you flunked it twice. You can flunk a subject for many reasons that have little to do with your ability to learn the topic. Make sure you identify what the real problem is and deal with that instead of just dinking around with symptoms.

Share this post


Link to post
Share on other sites
One reason why I love algebra so much! You just plug in numbers into an equation, solve it and boom you got ur answer. Is Calculus really a tough course because I live in Toronto, Canada in high school and I''m taking University preparation in High Scool (My mark in math now is like 87%).

-Assembly (x86/x87/MMX/3DNow!)
-C/C++
-Visual Basic
-Turing
(And only 15 years old!!)

Share this post


Link to post
Share on other sites
I am just finishing up grade 12, and this semester I took Math 31, which is basically a pre-university calculus course. If you have a good understanding of the math you''ve done so far ( and based on your 87% it looks like you do ) and are comfortable working with equations and graphs ( god bless the TI-83 ), you''ll probably do just fine.

Share this post


Link to post
Share on other sites
One of the areas where calculus is most helpful in computer science in general is understanding how functions grow. For example, the line Y=X and the curve Y=X**2 (x squared) grow differently. The prior on a linear path, I.E. for every one change in X, there is a 1 change in Y. The second grows exponentially, and you''ve sat through the class at least twice, so you should know what that means now. As it applies to computer science, when you analyze a function, you can determine the amount of time it would take, based on your knowledge of calculus.

Take this. BubbleSort versus MergeSort. BubbleSort probably has the worst of the worst cases imaginable, though I''m sure someone who really tried could find worse. Bubble sort takes N**2 execution time based on elemental comparison. Its obvious to see, considering that you need to do N comparisons on an array of N size, and you may have to run through the loop N times. Not knowing Calculus and mathematical fundamentals would not let you realize this fact before you try it the hard way (running it on an array of size Population Of Earth). Bubblesort is a flimsy example, but I don''t feel like describing QuickSort which incidentally has a N**2 worst case as well.

As it applys to games, it helps a great deal to know where your engine is tripping up and causing a 0.5FPS, or why the enemies have time to move before a bullet hits them. I know its a hard area of math, I myself barely passed Intermediate Calculus, but once you get passed it and head on to Abstract math, it gets fun.

-> Will Bubel
-> Machine wash cold, tumble dry.

Share this post


Link to post
Share on other sites
you dont need calculus to do anything, but once you understand calculus, you have a much bether view of what something is, how it si build up and how to get other informations of it.
result:
much faster understanding of a problem, much faster knowing the way to find the solution, much faster solved the problem. calculus wrapps most very specific problems to a generic mainproblem, wich you can solve in a generic way..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
quote:
Original post by Geocyte
I could be wrong but don''t you use calculus to do splines?



You need to solve a matrix to calculate a spline, so I think you would need more linear algebra.

Share this post


Link to post
Share on other sites