Java Array Cross Product cross2D(final float[] v1, final float[] v2)

Here you can find the source of cross2D(final float[] v1, final float[] v2)

Description

Computes the cross product of two 2D vectors.

License

Open Source License

Declaration

public static float cross2D(final float[] v1, final float[] v2) 

Method Source Code

//package com.java2s;
/*//from  www .  j  a va2s. c  om
 * #%L
 * VisBio application for visualization of multidimensional biological
 * image data.
 * %%
 * Copyright (C) 2002 - 2014 Board of Regents of the University of
 * Wisconsin-Madison.
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 2 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-2.0.html>.
 * #L%
 */

public class Main {
    /** Computes the cross product of two 2D vectors. */
    public static float cross2D(final float[] v1, final float[] v2) {
        return v1[0] * v2[1] - v1[1] * v2[0];
    }
}

Related

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