----------------------------------- jonos Fri Feb 20, 2004 11:51 pm 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.... :D ----------------------------------- Tony Sat Feb 21, 2004 12:34 am ----------------------------------- 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 ----------------------------------- jonos Sat Feb 21, 2004 9:30 am ----------------------------------- 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: 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 Sat Feb 21, 2004 10:24 am ----------------------------------- Why do you have c in there? It isn't doing anything :think: I know where you're coming from Jonos. I wanna learn physics too :( 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 :cry: But in the time being, just copy code from other ppls programs :) thoughtful's pool owns :) ----------------------------------- jonos Sat Feb 21, 2004 10:30 pm ----------------------------------- 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 Sat Feb 21, 2004 11:30 pm ----------------------------------- 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 Sun Feb 22, 2004 1:40 am ----------------------------------- 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 :lol: ----------------------------------- Acid Thu Feb 26, 2004 10:45 am ----------------------------------- 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. ----------------------------------- Cervantes Thu Feb 26, 2004 6:08 pm ----------------------------------- 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 Thu Feb 26, 2004 6:35 pm ----------------------------------- 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 Thu Feb 26, 2004 8:32 pm ----------------------------------- 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 :roll: ----------------------------------- shorthair Thu Feb 26, 2004 9:33 pm ----------------------------------- 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 Thu Feb 26, 2004 9:35 pm ----------------------------------- tat's it? we're doing sound, light and other types of waves rite now ----------------------------------- recneps Thu Feb 26, 2004 9:41 pm ----------------------------------- 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 Thu Feb 26, 2004 9:42 pm ----------------------------------- 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 , ----------------------------------- Tony Thu Feb 26, 2004 11:34 pm ----------------------------------- waves are kinda useless to programming unless you're modeling their behaviour :lol: ----------------------------------- BlAcK TuRtLe Thu Mar 04, 2004 4:36 pm ----------------------------------- forces in grade 11 we're doin right now. We just did gravitational forces. Its not that hard reall just alot of crummy formulae :x ----------------------------------- Tony Thu Mar 04, 2004 4:57 pm ----------------------------------- haha, just wait till physics 12 :lol: we get to calculate forces between quontum electrical charges in magnetic fields and such :lol: ----------------------------------- Homer_simpson Sun Mar 07, 2004 3:23 am ----------------------------------- for a good physics based program... u probably should know oop... for example let's say u wanna make simple physic world with simple laws of physics on it... now first u gotto create a world... in that world u can have ground,gravity,wall,etc... then u need some objects,and objects have properties like position,angle,mass,velocity,energy,etc... after that comes the physics engine... the physics engine is the part where u start applying rules of physics to yer object like:collision detection,gravitational pull,etc... and finally u can draw yer world and object... i had a physics particle engine posted here somewhere, check that out it's the perfect example for what i'm talking about...