马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×

- ;; ! ****************************************************************************
- ;; ! 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
- ;; ! (C) 1999-2004, Four Dimension Technologies, Bangalore
- ;; ! e-mail : [email]rakesh.rao@4d-technologies.com[/email]
- ;; ! Web : [url]www.4d-technologies.com[/url]
- ;; ! ****************************************************************************
- ;; 矢量差积
- ;|两个矢量的叉积
- | i j k |
- v1xv2 = | x1 y1 z1 |= (y1z2-y2z1, z1x2-z2x1, x1y2-x2y1)
- | x2 y2 z2 |
-
- |;
- (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))
- )
- )
- )
|