Java Array Cross Product cross(float[] v1, float[] v2, float[] out)

Here you can find the source of cross(float[] v1, float[] v2, float[] out)

Description

cross

License

Open Source License

Declaration

public static void cross(float[] v1, float[] v2, float[] out) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float[] cross(float[] v1, float[] v2) {
        float[] out = new float[3];
        cross(v1, v2, out);//from w w w  .  j ava2  s.com
        return out;
    }

    public static void cross(float[] v1, float[] v2, float[] out) {
        out[0] = v1[1] * v2[2] - v1[2] * v2[1];
        out[1] = v1[2] * v2[0] - v1[0] * v2[2];
        out[2] = v1[0] * v2[1] - v1[1] * v2[0];
    }
}

Related

  1. cross(double v1[], double v2[])
  2. cross(double[] p, double[] q)
  3. cross(double[] vec1, double[] vec2, double[] outvec)
  4. cross(final double[] a, final double[] b, final double[] c)
  5. cross(final double[] left, final double[] right)
  6. cross(float[] vec1, float[] vec2)
  7. cross(int x1, int y1, int x2, int y2)
  8. cross2D(final float[] v1, final float[] v2)
  9. cross2D(int[] v, int[] u)