From 668d369943b383ca91cd8222730e1179be99df89 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Thu, 29 May 2025 01:14:30 +0100 Subject: [PATCH] Define rotation transform --- drawing.lisp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drawing.lisp b/drawing.lisp index 42349fd..9c2b975 100644 --- a/drawing.lisp +++ b/drawing.lisp @@ -61,6 +61,10 @@ :y-transform (* scale-factor y) :scalar-transform (* scale-factor s)) +(define-transform rotate (theta) + :x-transform (- (* x (cos theta)) (* y (sin theta))) + :y-transform (+ (* x (sin theta)) (* y (cos theta)))) + (defun overlay (&rest drawings) (apply #'append drawings))