Here you can find the source of cross(double v0x, double v0y, double v1x, double v1y)
Parameter | Description |
---|---|
v0x | a parameter |
v0y | a parameter |
v1x | a parameter |
v1y | a parameter |
public static double cross(double v0x, double v0y, double v1x, double v1y)
//package com.java2s; /*/*from w w w .j a va 2 s. co m*/ * Copyright 2011 Mark McKay * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Calculates the 'cross product' of two vectors. This is the same as the * 3D version with the assumption that the vectors lie in the XY plane. The * Z component of the cross product is returned. * * @param v0x * @param v0y * @param v1x * @param v1y * @return */ public static double cross(double v0x, double v0y, double v1x, double v1y) { return v0x * v1y - v0y * v1x; } public static int cross(int v0x, int v0y, int v1x, int v1y) { return v0x * v1y - v0y * v1x; } }