Something went wrong. Try again.
A ray tracer in Coalton
Something went wrong. Try again.
12345678910111213141516171819202122232425262728(cl:defpackage #:ray/util (:use #:coalton #:coalton-prelude) (:local-nicknames (#:trig #:coalton/math/elementary)) (:export #:deg-to-rad #:rand-f64 #:rand-f64-range))
(cl:in-package #:ray/util)
(cl:declaim (cl:optimize (cl:speed 3) (cl:safety 0) (cl:debug 0)))
(coalton-toplevel
(inline) (declare deg-to-rad (F64 -> F64)) (define (deg-to-rad degrees) (* degrees (/ (the F64 trig:pi) 180.0d0))) (inline) (declare rand-f64 (Void -> F64)) (define (rand-f64) (lisp (-> F64) () (cl:random 1.0d0))) (inline) (declare rand-f64-range (F64 * F64 -> F64)) (define (rand-f64-range min max) (+ min (* (- max min) (rand-f64)))))