You are invited to Log in or Register a free Frihost Account!

How is caculus applied to computer science?

I'm a freshman of computer science and technology. Besides the C programming language, we have to study caculus and linear algebra as well. Unfortunately, I find myself interested in programming only and caculus quite hard and dull.
It seems to me computer science contributes a lot to the development of math, while I can't imagine how caculus be applied to computer science. Perhaps students who study maths should learn computer science.
Are we studying maths to find a new way to look at the world? I was told that a few days ago.
Calculus is essential. Any program which needs to model movement requires calculus - that is how you calculate things like velocity. Any time you need to calculate a specific value of a quantity that is continuously varying then you are likely to need calculus.

Computer science has contributed a little to the general subject of maths - particularly in complexity theory - but more often it is maths that provides the computer scientist with the tools he/she needs.

In short, you cannot hope to study computer science in any depth without a solid grounding in maths, and that includes calculus.
Bikerman is quite right: you can't be a good programmer without calculus.

Let's use games, for example (and i chose games because everyone knows them, and they are surprisingly sophisticated pieces of software engineering).

Your linear algebra will come into play heavily in the graphics engine. All modern games use 3D graphics, and under the hood, all 3D graphics is, is just a collection of points (vertices) that are usually 1x3 matrices (or 3 point vectors). You use transformation matrices and matrix multiplication to turn 3D objects around, and orient them in camera space so you can see them. And that's just the start.

Your calculus will come into play very heavily in the physics engine. Let's say your character throws a grenade down a hall: the grenade bounces off the wall and ricochets around the corner. To calculate the path of that grenade you don't try to figure out an equation that describes the path - which would be difficult to do even if you knew ahead of time what path the grenade would take (like, how many times would it ricochet?). Instead, you do a discrete calculation. You take the position p at time t, and figure out what happens at time Δt... which is one frame after t. And, if you check your fundamental definition of calculus, you will see it looks something like this:
dp         p(t + Δt) - p(t)
-- =  lim  ----------------
dt   Δt->0        Δt

In other words, calculus is the key to programming real-time simulations (along with many other things). If you know where you were in the last frame (which would be p(t)), you can find out where you are in the current frame (which would be p(t + Δt)) by using the equation: p(t + Δt) = (dp/dt) * Δt + p(t). So each frame you can take where you were in the last frame, and the time since the last frame, and figure out where you are in the current frame. That's how games do physics.
Yeah, the latest graphics cards and games offer particle physics to bring realistic environment. That is every time you shoot something (in FPS games) or collide with objects (NFS like), you get different result based on angle of strike, speed, distance etc, based on real world physics and mathematics. In India, most of the universities do not allow to study Computer Science unless you have physics and maths at your pre degree level.
Thanks for your replies, Bikerman and Indi~~ Maybe I'm just studying something basic of programming currently. I believe I'll need calculus and linear algebra sometime in the future. My C programming professor told us he was quite regretful that he hadn't learnt maths well.
Calculus seems much more difficult than linear algebra, though both are not easy to learn. Anyway, I'll try my best.
inuyasha wrote:
Are we studying maths to find a new way to look at the world? I was told that a few days ago.

No. We use math to determine how the world operates. Example: How much will a beam deflect under various loads?
Related topics
What are you studying or what's your profession?
What college did/do you go to?
Computer Science Education
Computer jokes (funny!)
What kind of science are you into?
What to do for a livin'?
Predeterminism and Computer Science
Engineering Degree
is taking bachelor of science in Computer Science hard?
I hate Vista.
Computer Science Quotes (1)
Is Completeing a BS in Computer Science Difficult?
About MsC in computer science
Computer Science Projects
Reply to topic    Frihost Forum Index -> Science -> Education

© 2005-2011 Frihost, forums powered by phpBB.