r10404: Initial import
[cl-photo.git] / convert.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10; Package: photo -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          convert.lisp
6 ;;;; Purpose:       Conversions functions for cl-photo
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  April 2005
9 ;;;;
10 ;;;; $Id: package.lisp 8596 2004-02-03 18:32:50Z kevin $
11 ;;;;
12 ;;;; This file, part of cl-photo, is Copyright (c) 2005 by Kevin Rosenberg.
13 ;;;; Rights of modification and redistribution are in the LICENSE file.
14 ;;;;
15 ;;;; *************************************************************************
16
17 (in-package #:photo)
18
19 (defconstant +radian->degrees+ (/ 360d0 pi 2))
20 (defconstant +inches->mm+ 25.4)
21
22 (defun diagonal (x y)
23   (sqrt (+ (* x x) (* y y))))
24
25 (defun radians->degrees (r)
26   (* +radian->degrees+ r))
27
28 (defun mm->feet (d)
29   (/ d +inches->mm+ 12))
30
31 (defun feet->mm (d)
32   (* d 12 +inches->mm+))
33