GithubHelp home page GithubHelp logo

n-body's Introduction

N-body

Hwi Ram Jeong CSC 144 : Software Architecture 3/24/2016

This project is for my CSC 144 : Software Architecture class
I started my project from the basic N-body simulation file(you can also find this file in this github)



Learn about a scientific computing application.
Learn about reading input using the StdIn library
printing formatted output using the StdOut library
Learn about plotting graphics using the StdDraw library
Learn about using the command line to redirect standard input to read from a file
Learn to build up complex results using a sequence of simple statements Use nested loops Use arrays

Background for this N-body simulation:
In 1687 Sir Isaac Newton formulated the principles governing the the motion of two particles under the influence of their mutual gravitational attraction in his famous Principia. However, Newton was unable to solve the problem for three particles. Indeed, in general, systems of three or more particles can only be solved numerically. Your challenge is to write a program to simulate the motion of N particles in the plane, mutually affected by gravitational forces, and animate the results. Such methods are widely used in cosmology, semiconductors, and fluid dynamics to study complex physical systems. Scientists also apply the same techniques to other pairwise interactions including Coulombic, Biot-Savart, and van der Waals.
For more information visit https://en.wikipedia.org/wiki/N-body_simulation

Changes I made from the basic N-body simulation
-Input format
The input format is a text file that contains the information for a particular universe. The basic input included the initial position, the initial velocity, and the mass. I added image input.
String image = inputStream.readString();
-Trails
For this function, i used ArrayList function. Also, I made the trace removed if the length is over certain number i set.
I added Math.Random to make the width of trail keep changing and getHSBColor to make the color keep changing randomly.
-Bouncing
I added bouncing function that if the objects hit the edges it bounces back.
if(x >= boundary && v.cartesian(0) > 0) { v.xBouncing();
-Background
i added the background picture by using stdDraw.picture
-JunitTest
I tested if the methods are working or not
-Javadoc
I created Javadoc file and explained each methods within

n-body's People

Contributors

hjeong16 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.