Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 physics and applying it to programming
Index -> General Programming
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jonos




PostPosted: Fri Feb 20, 2004 11:51 pm   Post subject: physics and applying it to programming

im trying to learn how to apply physics (grade 10) to programming, but its really hard, and im not very good at that kind of stuff. if anyone wants to post something that could be helpful, and easy to understand, it would be really good for me and some other people who may not know what to do. ive heard catalyst can explain this stuff good.... Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Feb 21, 2004 12:34 am   Post subject: (No subject)

I dont think thats the way it works... you dont just learn a concept and stick that into your program. Its rether you're writing a program and you're required to use a specific approach.

Oftentimes in games you would be required to model physically correct situations, and thats where knowledge comes in.

So how about you tell us what you want to know, and we'll fill you in
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
jonos




PostPosted: Sat Feb 21, 2004 9:30 am   Post subject: (No subject)

well i was bothering shorthair about this, and i was trying to get realistic acceleration and speed. this is what i got:

this has nothing to do with the formula a=v/t (i think) which i was trying to apply, but this is all i could work out:

code:

setscreen ("graphics:700, 100")

var a : int := maxy div 2
var b, c : int := 1

loop
    drawline (20, 0, 20, maxy, black)
    drawline (maxx - 20, 0, maxx - 20, maxy, black)
    drawoval (a, maxy div 2, 5, 5, brightred)
    a := a + b
    b := b + 1
    c := b
    exit when a > maxx - 20
    delay (25)
    cls
end loop
Cervantes




PostPosted: Sat Feb 21, 2004 10:24 am   Post subject: (No subject)

Why do you have c in there? It isn't doing anything Thinking

I know where you're coming from Jonos. I wanna learn physics too Sad But you can't expect to learn all the physics you need from compsci. I think we're just gunna have to wait until gr 11 Crying or Very sad

But in the time being, just copy code from other ppls programs Smile thoughtful's pool owns Smile
jonos




PostPosted: Sat Feb 21, 2004 10:30 pm   Post subject: (No subject)

finally!!! someone who knows what it feels like. the c was there for something else i was trying but didn't work. i just forgot to remove it. yeah, maybe i should just wait, or try making simple things.

does the acceleration thing look okay though?
jonos




PostPosted: Sat Feb 21, 2004 11:30 pm   Post subject: (No subject)

i know its good (thoughtful's thing), but i need to know about the cos and sin and tan and all that, so maybe i should just wait, or read the math text (we aren't there yet)
Tony




PostPosted: Sun Feb 22, 2004 1:40 am   Post subject: (No subject)

i recomend teaching yourself trig from math 10 first, then forces from physics 11

the cool thing is that not only will it help you in programming, but you'll also do great when it comes to actually 'learning' those units in school Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Acid




PostPosted: Thu Feb 26, 2004 10:45 am   Post subject: (No subject)

I once made a VB program that graphed projectile motion. All you had to input was the initial velocity upward.

It can be graphed as a quadratic function like this:

Y = V1(X) - 9.8 (X^2)

Where Y is the height, X is the time in seconds, and V1 is the initial velocity. Since the acceleration due to gravity is 9.8 m/s^2 the maximum Y value will be the maximum height of the projectile, and the second X value will be when the object hits the ground.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Feb 26, 2004 6:08 pm   Post subject: (No subject)

tony -> Forces in Gr 11? Is that different from the motion unit that my class did in gr 10 science?

we did a bunch of stuff with vectors, Scale Diagrams and (crappy having Math sem 2 and science sem 1) kinematic equations.
wtd




PostPosted: Thu Feb 26, 2004 6:35 pm   Post subject: (No subject)

If you plan to do a lot of math or physics work when it comes to programming, it may be worth it check out a functional programming language like Haskell, Lisp, OCaml, or even Dylan.
Tony




PostPosted: Thu Feb 26, 2004 8:32 pm   Post subject: (No subject)

Cervantes -> gr11 physics takes a deeper look at the workings of the kinematics... like various forces involved and such... I dont really remember anything from grade 10... such a long way back Rolling Eyes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
shorthair




PostPosted: Thu Feb 26, 2004 9:33 pm   Post subject: (No subject)

good old kinematics , graviational and potential energy ,, thats a great part of physics , we got to built a trebuche and a mortar aswellwhen we did projectiles
Andy




PostPosted: Thu Feb 26, 2004 9:35 pm   Post subject: (No subject)

tat's it? we're doing sound, light and other types of waves rite now
recneps




PostPosted: Thu Feb 26, 2004 9:41 pm   Post subject: (No subject)

in Gr 10, all we did was velocity, acceleration, and how to calculate different forms with GRESS (and review on slope, how to draw graphs, etc:D)
shorthair




PostPosted: Thu Feb 26, 2004 9:42 pm   Post subject: (No subject)

there good , transverse waves and longitudinal waves , doppler effect ( can be used with sound aswell as light , though based on redand blue shift ) ....... Grade 11 has a great intro to physics ,
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: