Here you can find the source of cross2D(int[] v, int[] u)
Parameter | Description |
---|---|
v | 1st Vector |
u | 2nd Vector |
public static int cross2D(int[] v, int[] u)
//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]; } }