我喜欢找Matrix-Lib.LSP
 - ;;-----------------------------------------------------------;;
- ;; 二维旋转变换矩阵 ;;
- ;; 参数: ;;
- ;; Cen - 基点 ;;
- ;; ang - 旋转角度 ;;
- ;;-----------------------------------------------------------;;
- ;;-----------------=={ Rotate by Matrix }==------------------;;
- ;; ;;
- ;; Rotation Matrix ;;
- ;;-----------------------------------------------------------;;
- ;; Author: highflybird, Copyright ? 2012 ;;
- ;;-----------------------------------------------------------;;
- ;; Arguments: ;;
- ;; Cen - Base Point for Rotation Transformation ;;
- ;; ang - Angle through which to rotate object ;;
- ;;-----------------------------------------------------------;;
- (defun MAT:Rotation ( Cen ang / c s x y)
- (setq c (cos ang) s (sin ang))
- (setq x (car Cen) y (cadr Cen))
- (list
- (list c (- s) 0. (- x (- (* c x) (* s y))))
- (list s c 0. (- y (+ (* s x) (* c y))))
- '(0. 0. 1. 0.)
- '(0. 0. 0. 1.)
- )
- )
|