31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
;; ROTATE-3-BY-3
|
|
;; By Peter Reidy
|
|
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>ROTATE-3-BY-3.TEST
|
|
;; Syntax: (ROTATE-3-BY-3 &optional RESULT)
|
|
;; Function description: returns a 3-by-3 rotation specified by a counter-clockwise rotation oF RADIANS radians. If RESULT is supplied and is a 3-by-3 single-float matrix, it is set to the function's result.
|
|
;; Arguments: RESULT: a 3-by-3 single-float matrix.
|
|
;;
|
|
(do-test-group rotate-3-by-3-group
|
|
:before
|
|
(progn
|
|
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
|
|
(test-setq sample (make-array '(3 3) :initial-contents '((1.0 2.0 3.0)(4.0 5.0 6.0)(7.0 8.0 9.0)) :element-type 'single-float))
|
|
)
|
|
(do-test rotate-3-by-3-simple-case
|
|
(matrix-p (il:rotate-3-by-3 (randmost)) 3)
|
|
)
|
|
;;
|
|
(do-test rotate-3-by-3-with-result
|
|
(let ((rads (randmost)))
|
|
(and
|
|
(not (equal (2dlist sample) (2dlist (il:rotate-3-by-3 rads)))) ; before
|
|
(il:rotate-3-by-3 rads sample)
|
|
(equal (2dlist sample) (2dlist (il:rotate-3-by-3 rads))) ; after
|
|
)
|
|
)
|
|
)
|
|
)
|
|
END
|
|
|
|
|