Function: calcFunc-cross

calcFunc-cross is an autoloaded and byte-compiled function defined in calc-vec.el.gz.

Signature

(calcFunc-cross A B)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-vec.el.gz
;;; Compute a right-handed vector cross product.  [O O O] [Public]
(defun calcFunc-cross (a b)
  (if (and (eq (car-safe a) 'vec)
	   (= (length a) 4))
      (if (and (eq (car-safe b) 'vec)
	       (= (length b) 4))
	  (list 'vec
		(math-sub (math-mul (nth 2 a) (nth 3 b))
			  (math-mul (nth 3 a) (nth 2 b)))
		(math-sub (math-mul (nth 3 a) (nth 1 b))
			  (math-mul (nth 1 a) (nth 3 b)))
		(math-sub (math-mul (nth 1 a) (nth 2 b))
			  (math-mul (nth 2 a) (nth 1 b))))
	(math-reject-arg b "*Three-vector expected"))
    (math-reject-arg a "*Three-vector expected")))