;; | ---------------------------------------------------------------------------- ;; | GE_VecCrossProduct ;; | ---------------------------------------------------------------------------- ;; | Function : Computes the cross products of two vectors ;; | ;; | Arguments: 'v1' - First vector ;; | 'v2' - Second Vector ;; | ;; | Returns : 'v' - The cross product of the two vectors ;; | ;; | Comments: The cross product of two vectors is a vector in a plane ;; | perpendicular to the two vectors. This direction is the normal ;; | to the plane of the two vectors ;; | Theory: Say you have two vectors ;; | A= ax i + ay j + az k ;; | B= bx i + by j + bz k ;; | ;; | then A X B = (ay bz - az by) i + (az bx - ax bz) j + (ax by - ay bx) k ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_VecCrossProduct(v1 v2) (list (- (* (cadr v1) (caddr v2)) (* (cadr v2) (caddr v1)) ) (- (* (caddr v1) (car v2)) (* (caddr v2) (car v1)) ) (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1)) ) ) )