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

Username:   Password: 
 RegisterRegister   
 Gravity
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2, 3  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Catalyst




PostPosted: Fri Jan 23, 2004 10:58 pm   Post subject: Gravity

I was bored in comp sci. so i made this


grav.zip
 Description:

Download
 Filename:  grav.zip
 Filesize:  273.57 KB
 Downloaded:  382 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
sport




PostPosted: Fri Jan 23, 2004 11:03 pm   Post subject: (No subject)

Great program for being bored. Is it random or does it actually have a scientific way to it?
Catalyst




PostPosted: Fri Jan 23, 2004 11:05 pm   Post subject: (No subject)

uses Newton's
gravitational attraction formula and some vector math
Fg=(m1*m2*G)/(d^2)
AsianSensation




PostPosted: Fri Jan 23, 2004 11:07 pm   Post subject: (No subject)

nice physics stuff, did you do this during your compsci class? Laughing it seems that's when you seem to be bored most of the time.
Catalyst




PostPosted: Fri Jan 23, 2004 11:11 pm   Post subject: (No subject)

a lesson on selection (5 months in to ICS3M(full year))
i think you get the idea
Homer_simpson




PostPosted: Sat Jan 24, 2004 12:48 am   Post subject: (No subject)

pretty nice +bits
shorthair




PostPosted: Sat Jan 24, 2004 12:56 am   Post subject: (No subject)

I watched for 15 mins and they dont seem to be going into the center, they stay on there path ,is it becasue its based on a real algorithm
Tony




PostPosted: Sat Jan 24, 2004 1:27 am   Post subject: (No subject)

wow catalyst - if I was your CS teacher I'd made sure you're ALWAYS bored in my class Laughing

shorthair - they damn better stay on the path, else Earth will fly right into the sun, and as far as I know, that ain't cool... that's in fact very HOT Twisted Evil
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Jan 31, 2004 10:18 am   Post subject: (No subject)

wow that's a really good program!

but seriously shorthair, 15 minutes?! crazy..

anyone know off the top of their head if that's the same formula used in the example programs that deal with gravity?
shorthair




PostPosted: Sat Jan 31, 2004 10:23 am   Post subject: (No subject)

when i made one , i used potential energy , and kinetic energy formulas , and obviously your good ol , s = d / t, d = s * t , t = d/s ,.............. i had alot more than one formula
Cervantes




PostPosted: Sat Jan 31, 2004 10:29 am   Post subject: (No subject)

wanna post it? Smile
shorthair




PostPosted: Sat Jan 31, 2004 10:41 am   Post subject: (No subject)

Its not turing , as its dense with graphics ( uses direct X , 0 made with Blitz 3d , you should bee able to understand the code , il ost it if your still intersted in it ,
Here is a tutorial ( i have written yes i actually wrote it ) concerning hte gravitational equations , you will need for orbit , and force attraction
===============================================
code:

The force of attraction, F, between two bodies of mass m1 and m2 is

F = Gm1m2
     ----------
     R squared

 m1 and m2 = the mass of both the ojects

 R = distance between the two bodies

 G = the universal gravitational constant = 6.67 x 10-11 N m2 kg-2


===============================================
code:


Gravitational acceleration, g, of an arbitrary body  :

g=G Me
    ------
    R squared

Me = Mass of the Earth 

R   = distance from the Earth's centre.

code:


Gravitational acceleration on the Earth's surface (assuming it is spherical mass) :

g=G Me
    ------
    Re squared

Re =radius of the Earth.

g = 9.81 m/s/s


===============================================
code:

The corresponding potential, U, is :
U = -6.25 x 107 m2 s-2
Cervantes




PostPosted: Sat Jan 31, 2004 10:54 am   Post subject: (No subject)

interesting, how'd you learn to do this??
I am interested in seeing this program, if you would be so kind as to post it Smile

I think in gr 12 (thats the old gr 12, back when there was OAC / gr 13) my brother made a program (not sure what in) that showed the solar system in its orbit. It also allowed you to change values such as mass for the planets, distance from the sun, etc. I'd like to learn to make a program like that, but I'm not there yet.. Sad someday..
McKenzie




PostPosted: Sat Jan 31, 2004 11:10 am   Post subject: (No subject)

You didn't move from Ajax by chance did you? A few years back when I was teaching in Ajax I had a student make what sounds like the exact same program.
Cervantes




PostPosted: Sat Jan 31, 2004 12:40 pm   Post subject: (No subject)

me? no. been in Newmarket (well, near there) almost all my life. moved when I was two Razz
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

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


Style:  
Search: