Android examples for java.lang:Math Vector
Adds two vectors (a+b).
//package com.java2s; public class Main { /**// w ww. j ava2s .co m * Adds two vectors (a+b). * @param a The first vector * @param b The second vector * @param result Storage for the result, if null, do nothing. **/ public static void add(int size, float[] a, int offsetA, float[] b, int offsetB, float[] result, int offsetResult) { if (result == null) { return; } for (int i = 0; i < size; i++) result[offsetResult + i] = a[offsetA + i] + b[offsetB + i]; } }