added smaller version of directo for something in between tiny and full tests of...
[IRC.git] / Robust / src / Benchmarks / mlp / directto / mlp-small-for-testing / Velocity.java
1 // the class that describes coordinates the velocity of a plane
2
3 //import java.lang.*;
4
5 public class Velocity {
6
7   public Point4d vector;
8   public double speed;
9
10   Velocity() {
11     Velocity(0,0,0);
12   }
13   
14   Velocity(double newX, double newY, double newZ) {
15     this.vector=new Point4d(newX, newY, newZ);
16     this.speed=this.horizSpeed();
17   } 
18
19   public static Velocity copyOf(Velocity v) {    
20     return new Velocity( v );
21   }
22   
23   Velocity (Velocity v) {
24     this.vector=new Point4d (v.vector);
25     this.speed=this.horizSpeed();
26   }
27
28   public double horizSpeed() {
29     return Math.sqrt(Math.pow(vector.x,2.0)+Math.pow(vector.y,2.0));
30   }
31   
32   public String toString() {
33     return vector.toString();
34   }
35 }