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
diff --git a/Robust/src/Benchmarks/mlp/directto/mlp-small-for-testing/Velocity.java b/Robust/src/Benchmarks/mlp/directto/mlp-small-for-testing/Velocity.java
new file mode 100644 (file)
index 0000000..c4513c0
--- /dev/null
@@ -0,0 +1,35 @@
+// the class that describes coordinates the velocity of a plane
+
+//import java.lang.*;
+
+public class Velocity {
+
+  public Point4d vector;
+  public double speed;
+
+  Velocity() {
+    Velocity(0,0,0);
+  }
+  
+  Velocity(double newX, double newY, double newZ) {
+    this.vector=new Point4d(newX, newY, newZ);
+    this.speed=this.horizSpeed();
+  } 
+
+  public static Velocity copyOf(Velocity v) {    
+    return new Velocity( v );
+  }
+  
+  Velocity (Velocity v) {
+    this.vector=new Point4d (v.vector);
+    this.speed=this.horizSpeed();
+  }
+
+  public double horizSpeed() {
+    return Math.sqrt(Math.pow(vector.x,2.0)+Math.pow(vector.y,2.0));
+  }
+  
+  public String toString() {
+    return vector.toString();
+  }
+}