Important alert: (current site time 7/15/2013 9:19:58 AM EDT)
 

winzip icon

Orbiting Particles

Email
Submitted on: 8/9/2002 12:30:57 AM
By: Sarah Mathiason 
Level: Advanced
User Rating: By 13 Users
Compatibility: VB.NET
Views: 11170
(About the author)
 
     This code creates up to 10 particles. Each particle has a random mass, initial speed, position, and initial direction. Each particle will then interact with the other particles on the screen and all will adjust positions, speed, and direction according to the gravitational forces affecting it. By modifying the code to create customized particles instead of randomly generated particles the user can: -Create a solar system with orbiting planets around a sun. -Change the limit set to maximum gravity and watch a 'slingshot' effect. -Add friction to the particles and watch as several particles collect together. (to do these, you can modify the presets in the code, or create your own) Three new objects are created: VectorPoint, Vector, and Particle. A particle contains a Vector, which uses a VectorPoint. Beginners can see how to set up their own custom objects, and how to use an object as a property of another object.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
8/12/2002 12:02:02 PMChris

Excellent work ! I haven't had a chance to delve into the code yet but I have enjoyed playing with the program. Great job.
(If this comment was disrespectful, please report it.)

 
8/15/2002 6:11:32 AM{ pHroZeN GeeK }

Really nice program Andrew. 5 rounds from me :)
(If this comment was disrespectful, please report it.)

 
11/22/2002 11:31:54 AM

Neat...
You must have spend quite some doing this work :-) 5 from me
(If this comment was disrespectful, please report it.)

 
2/16/2003 2:05:51 AM

Excellent code Andrew. The classes are very impressive and I appreciate all the comments you added to each procedure. Thanks for a great submission. 5 planets! -Mark F
(If this comment was disrespectful, please report it.)

 
12/21/2003 9:00:10 PMRMD Software

Very great code! The only thing : the VectorPoint class is not necessary; .NET provides the PointF (System.Drawing.PointF) structure which is the same as Point but with float (single) coordinates...
(If this comment was disrespectful, please report it.)

 
7/29/2005 2:20:50 AMDeepak Kumar Shaw

good work
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.