Java Utililty Methods Vector Subtract

List of utility methods to do Vector Subtract

Description

The list of methods to do Vector Subtract are organized into topic(s).

Method

StringvectorSubstract(float x1, float y1, float x2, float y2)
vector Substract
return (x1 + " " + y1 + " " + x2 + " " + y2 + " vsub");
double[]vectorSubtract(double[] v1, double[] v2)
vector Subtract
if (v1.length != v2.length) {
    throw new IllegalArgumentException("v1.length != v2.length");
double[] res = new double[v1.length];
for (int i = 0; i < v1.length; i++) {
    res[i] = v1[i] - v2[i];
return res;
...
double[]vectorSubtract(double[] v1, double[] v2)
Performs vector subtraction.
double[] result = new double[v1.length];
for (int i = 0; i < result.length; i++) {
    result[i] = v1[i] - v2[i];
return result;