Java Array Cross Product cross2D(int[] v, int[] u)

Here you can find the source of cross2D(int[] v, int[] u)

Description

2D cross product.

License

Open Source License

Parameter

Parameter Description
v 1st Vector
u 2nd Vector

Return

The cross product

Declaration

public static int cross2D(int[] v, int[] u) 

Method Source Code

//package com.java2s;

public class Main {
    /**/* w  w w. j a va 2s .  c  o  m*/
     * 2D cross product. Returns a z-value.
     *
     * @param v 1st Vector
     * @param u 2nd Vector
     * @return The cross product
     */
    public static int cross2D(int[] v, int[] u) {
        return v[0] * u[1] - v[1] * u[0];
    }

    /**
     * 2D cross product
     *
     * @param v a float array
     * @param u a float array
     * @return The cross product
     */
    public static float cross2D(float[] v, float[] u) {
        return v[0] * u[1] - v[1] * u[0];
    }
}

Related

  1. cross(final double[] left, final double[] right)
  2. cross(float[] v1, float[] v2, float[] out)
  3. cross(float[] vec1, float[] vec2)
  4. cross(int x1, int y1, int x2, int y2)
  5. cross2D(final float[] v1, final float[] v2)
  6. cross3(double x1, double y1, double z1, double x2, double y2, double z2)
  7. cross33(float u[], float v[])
  8. crossEndForLineVectorAlgebra(double x1, double y1, double x2, double y2, double margin, double width)
  9. crossMuliply(double a, double b, double c)