GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Sep-2004, 17:55
forgivenothing forgivenothing is offline
New Member
 
Join Date: Sep 2004
Posts: 3
forgivenothing is on a distinguished road

Question about Programming


Hello. I am currently enrolled in an AP Calculus class, and I have to do a report on how Calculus is used in Programming. If anyone has an answer to that, a link to where I could find the answer, or knows of anyone who may have the answer, I would greatly appreciate it. Thank you for your help.

-Scott
  #2  
Old 24-Sep-2004, 21:02
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,550
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
Well, I don't know about other programmers, but I personally haven't had to use it yet. But the further you progress in programming, especially w/ regards to game design, you'll encounter more of a need for calc.

3D design, and especially first-person shooters, rely heavily on vector math, which means calculus. Most day-to-day programs don't require advanced math, though I'm sure other members can give examples.

Offhand, I can see advanced math being used w/ computers to design math-based apps, e.g. statisical analysis or epidemic tracking. Every computer science course requires higher math, but as far as I can see, it's mostly to have a strong math background for when you need it. Plus algorithim design will put it to good use. As you get further along in calc, you'll find that it can be used to provide shortcuts for things you already know how to do.

I couldn't find many sites expressly talking about calc and programming, but you can search for "applied calculus" and see what pops up. Here's 2 of the better sites I found: Calculus in Context and Applied Calculus.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
Last edited by crystalattice : 24-Sep-2004 at 21:03. Reason: Additional thought
  #3  
Old 24-Sep-2004, 21:26
forgivenothing forgivenothing is offline
New Member
 
Join Date: Sep 2004
Posts: 3
forgivenothing is on a distinguished road
Thanks crystalattice. Those sites helped. Does anyone have any knowledge of Calculus used in game design? Thanks.
  #4  
Old 25-Sep-2004, 09:20
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,720
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold
Well, my first response would be something like, "Programming without calculus is like a fish without a bicycle." I rarely get up in the morning and think, "Now, I wonder how I can write a program today that uses what I learned in Calculus 101." Note that I understand that "using what I learned in Calculus 101" is not quite the same as "how calculus is used in programming".

First and foremost, since our understanding of the laws of physics (as applied to our attempt at understanding how the universe works) is based on systems of second order differential equations, one could say that calculus is used in everything I do all day, every day (including programming, which I do only occasionally). Knowledge of second order differential equations is not covered in Calculus 101 (at least it wasn't when I took Calculus back in 19... never mind), but calculus is the basis for knowledge about differential equations.

Well, enough vague generalities; maybe you would like me to focus a little on your question.

Lots of programs are explicitly based on principles of calculus.

If you are given a number of data points and you want to spot a trend, one way is to try to fit an equation to the data points. Criteria for selecting the "best fit" for an equation typically include something like "minimizing the least square error" between the data points and values from the equation. This is calculus (minimizing a function is sometimes done by setting the first derivative of the function to zero and solving for something). If we find a function that is a good fit for the given data, sometimes we try to extend the function to predict what will happen next. Coupled with a knowledge of the defining differential equations, our approximating function can give us valuable information (predicting the course of hurricanes, for example). Coupled with an incomplete or incorrect understanding of underlying principles, the curve fitting problem can lead to less successful conclusions (trying to extrapolate stock market prices by fitting a curve to prior data, for example).

People with no knowledge of calculus can use programs (and even write programs) based on formulas for "minimizing the least square error", but a lack of understanding of what's really happening can lead to acceptance of incorrect or irrelevant results. Every one has heard of "Garbage In --- Garbage Out", but I see lots of Garbage Out every day coming from people who don't have the vaguest idea of what the computer program is actually doing.

Another example (a little more technical): I want to write a program that controls the motion of an elevator. (There is a computer embedded in the control system of the elevator that responds to someone pushing a button by sending the elevator to a particular floor.) Let y = f(t) be the function of motion of the elevator, where t is time and y is the position. In calculus we learn that velocity is the derivative of position with respect to time, and acceleration is the second derivative of position with respect to time. (Thus giving rise to a second order differential equation --- see, I told you.)

To make the elevator come to a stop, I want to find the function f(t), such the velocity must be equal to zero when the elevator comes to the desired position. To make the elevator come to a stop smoothly, the acceleration must be equal to zero when the elevator comes to the desired position. These are called boundary conditions. The real-time control signals to the elevator mechanism are determined by the solution of the second-order differential equation with the given boundary conditions.

Just a couple off of the top of my head. You can look up programs on Digital Signal Processing, Communications (extracting signals from noise, based on various mathematical transforms that you can't even think about without calculus), etc.

Regards,

Dave
  #5  
Old 25-Sep-2004, 10:45
forgivenothing forgivenothing is offline
New Member
 
Join Date: Sep 2004
Posts: 3
forgivenothing is on a distinguished road
Wow, thanks Dave. Now I think I understand where my teacher was coming from when she gave me the assignment. I greatly appreciate it.

-Scott
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 4) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
GUI programming crystalattice C++ Forum 5 14-Sep-2004 12:17
Creating Thread Question!!! Melvin Lin C Programming Language 3 20-Mar-2004 09:08
question of practice magiccreative C++ Forum 1 06-Feb-2004 07:17
a C input question tmike C Programming Language 1 16-Sep-2003 02:31

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:56.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.