aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils.lisp
blob: 3598ec319fd3838f9f3a1ddf444304d81c3e2904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
;;;; utils.lisp

(in-package #:wheelwork)

(define-symbol-macro +pi-over-180+ 0.017453292519943295d0)

(defun radians (degrees)
  "Converse DEGREES to radians"
  (* degrees +pi-over-180+))

(defun safe-slot (object slot &optional default)
  (if-let (val (and (slot-exists-p object slot)
                    (slot-boundp object slot)
                    (slot-value object slot)))
    val
    default))