//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; }
//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); }
//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); }
//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); }
//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; }
//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); }