Here you can find the source of vectorAdd(float[] v1, float[] v2)
Parameter | Description |
---|---|
v1 | vector 1 |
v2 | vector 2 |
public static float[] vectorAdd(float[] v1, float[] v2)
//package com.java2s; public class Main { /** Adds to vectors/* www . ja v a2 s .com*/ * @param v1 vector 1 * @param v2 vector 2 * @return v1 + v2 */ public static float[] vectorAdd(float[] v1, float[] v2) { float[] newVector = new float[3]; newVector[0] = v1[0] + v2[0]; newVector[1] = v1[1] + v2[1]; newVector[2] = v1[2] + v2[2]; return newVector; } }