mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
removing div() and mult() by vectors #1544
This commit is contained in:
@@ -573,30 +573,6 @@ public class PVector implements Serializable {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void mult(PVector v) {
|
||||
x *= v.x;
|
||||
y *= v.y;
|
||||
z *= v.z;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param v1 the x, y, and z components of a PVector
|
||||
* @param v2 the x, y, and z components of a PVector
|
||||
*/
|
||||
static public PVector mult(PVector v1, PVector v2) {
|
||||
return mult(v1, v2, null);
|
||||
}
|
||||
|
||||
|
||||
static public PVector mult(PVector v1, PVector v2, PVector target) {
|
||||
if (target == null) {
|
||||
target = new PVector(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
|
||||
} else {
|
||||
target.set(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -644,34 +620,6 @@ public class PVector implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Divide each element of one vector by the elements of another vector.
|
||||
*/
|
||||
public void div(PVector v) {
|
||||
x /= v.x;
|
||||
y /= v.y;
|
||||
z /= v.z;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Divide each element of one vector by the individual elements of another
|
||||
* vector, and return the result as a new PVector.
|
||||
*/
|
||||
static public PVector div(PVector v1, PVector v2) {
|
||||
return div(v1, v2, null);
|
||||
}
|
||||
|
||||
static public PVector div(PVector v1, PVector v2, PVector target) {
|
||||
if (target == null) {
|
||||
target = new PVector(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
|
||||
} else {
|
||||
target.set(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_dist.xml )
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user