Here you can find the source of divVec2(final float[] result, final float[] vector, final float scale)
Parameter | Description |
---|---|
result | vector for the result, may be vector (in-place) |
vector | input vector |
scale | single scale constant for all vector components |
public static float[] divVec2(final float[] result, final float[] vector, final float scale)
//package com.java2s; public class Main { /**//from w w w .j a v a 2 s. co m * Divides a vector by param using given result float[], result = vector / scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale single scale constant for all vector components * @return result vector for chaining */ public static float[] divVec2(final float[] result, final float[] vector, final float scale) { result[0] = vector[0] / scale; result[1] = vector[1] / scale; return result; } /** * Divides a vector by param using given result float[], result = vector / scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale 2 component scale constant for each vector component * @return result vector for chaining */ public static float[] divVec2(final float[] result, final float[] vector, final float[] scale) { result[0] = vector[0] / scale[0]; result[1] = vector[1] / scale[1]; return result; } }