예제 #1
0
 //PVector.dist
 public double dist(PVector v2)
 {
     Vector2 vv1 = new Vector2(this.x, this.y);
     Vector2 vv2 = new Vector2(v2.x, v2.y);
     double v_dist = (vv1-vv2).Length;
     return v_dist;
 }
예제 #2
0
 //METHODS
 //----------------------------------------------------------------
 //PVector.sub
 public static PVector sub(PVector v1, PVector v2)
 {
     Vector2 rV = Vector2.Subtract(new Vector2(v1.x,v1.y), new Vector2(v1.x,v1.y));
     return new PVector(rV.X, rV.Y);
 }
예제 #3
0
 //PVector.mult
 public static PVector mult(double f, PVector v2)
 {
     Vector2 rV = Vector2.Multiply(f, new Vector2(v2.x,v2.y));
     return new PVector(rV.X, rV.Y);
 }
예제 #4
0
 //PVector.div
 public static PVector div(double f, PVector v2)
 {
     Vector2 rV = Vector2.Divide(new Vector2(v2.x, v2.y), f);
     return new PVector(rV.X, rV.Y);
 }
예제 #5
0
 //PVector.dist
 public static double dist(PVector v1, PVector v2)
 {
     Vector2 vv1 = new Vector2(v1.x, v1.y);
     Vector2 vv2 = new Vector2(v2.x, v2.y);
     double v_dist = (vv1-vv2).Length;
     return v_dist;
 }
예제 #6
0
 //PVector.add
 public static PVector add(PVector v1, PVector v2)
 {
     Vector2 rV = Vector2.Add(new Vector2(v1.x,v1.y), new Vector2(v1.x,v1.y));
     return new PVector(rV.X, rV.Y);
 }