Here you can find the source of subtract(double[] a, double[] b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static double[] subtract(double[] a, double[] b)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w .j a va 2s . c om * Subtracts two points * * @param a * @param b * @return a-b */ public static double[] subtract(double[] a, double[] b) { if (a.length != b.length) throw new IllegalArgumentException("Subtracted two not matching Vectors."); double[] erg = new double[a.length]; for (int i = 0; i < a.length; i++) { erg[i] = a[i] - b[i]; } return erg; } }