Advertisement
calcpage

LACS09_Body.java

Jun 21st, 2012
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.29 KB | None | 0 0
  1. //Body.java MrG 2012.0621
  2. public class Body
  3. {
  4.     private Vector r;
  5.     private Vector v;
  6.  
  7.     public Body(Vector r, Vector v)
  8.     {
  9.         this.r=r;
  10.         this.v=v;
  11.     }
  12.  
  13.     public void draw()
  14.     {
  15.         StdDraw.point(r.getX(),r.getY());
  16.     }
  17.  
  18.     public void move(double time)
  19.     {
  20.         r = r.sum(v.dilate(time));
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement