Java Vector Cross Product CrossVec3D(double[] vec3Ret, double[] vec3A, double[] vec3B)

Here you can find the source of CrossVec3D(double[] vec3Ret, double[] vec3A, double[] vec3B)

Description

Cross Vec D

License

Open Source License

Declaration

public static void CrossVec3D(double[] vec3Ret, double[] vec3A, double[] vec3B) 

Method Source Code

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

public class Main {
    public static void CrossVec3D(double[] vec3Ret, double[] vec3A, double[] vec3B) {
        // From: http://en.wikipedia.org/wiki/Cross_product
        vec3Ret[0] = vec3A[1] * vec3B[2] - vec3A[2] * vec3B[1];
        vec3Ret[1] = vec3A[2] * vec3B[0] - vec3A[0] * vec3B[2];
        vec3Ret[2] = vec3A[0] * vec3B[1] - vec3A[1] * vec3B[0];
    }//from   w  ww .  ja  v a  2  s.co m
}

Related

  1. crossVec3(final float[] result, final float[] v1, final float[] v2)