33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
;; ROTATE-4-BY-4-ABOUT-Z
|
|
;; By Peter Reidy
|
|
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>ROTATE-4-BY-4-ABOUT-Z.TEST
|
|
;; Syntax: (ROTATE-4-BY-4-ABOUT-Z RADIANS &optional RESULT)
|
|
;; Function description: returns a 4-by-4 rotation matrix specified by a positive right-hand rotation of RADIANS radians about the Z axis. If RESULT is supplied and is a 4-by-4 single-float matrix, it is set to the function's result.
|
|
;; Arguments:
|
|
;; RADIANS: a real number
|
|
;; RESULT: a 4-by-4 single-float matrix.
|
|
;;
|
|
(do-test-group rotate-4-by-4-about-z-group
|
|
:before
|
|
(progn
|
|
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
|
|
(test-setq sample (make-array '(4 4) :initial-contents '((1.0 2.0 3.0 4.0) (5.0 6.0 7.0 8.0) (9.0 10.0 11.0 12.0) (13.0 14.0 15.0 16.0)) :element-type 'single-float))
|
|
)
|
|
(do-test rotate-4-by-4-simple-case
|
|
(matrix-p (il:rotate-4-by-4-about-z (randmost)) 4)
|
|
)
|
|
;;
|
|
(do-test rotate-4-by-4-about-z-with-result
|
|
(let ((rads (randmost)))
|
|
(and
|
|
(not (equal (2dlist sample) (2dlist (il:rotate-4-by-4-about-z rads)))) ; before
|
|
(il:rotate-4-by-4-about-z rads sample)
|
|
(equal (2dlist sample) (2dlist (il:rotate-4-by-4-about-z rads))) ; after
|
|
)
|
|
)
|
|
)
|
|
)
|
|
END
|
|
|
|
|