- ;; mht created on Nov 9, 2011
-
-
;; constant definitions
-
(define in2cm 2.54)
-
(define ft2in 12)
-
(define yd2ft 3)
-
(define rd2yd (* 5 (/ 1 2)))
-
(define fl2rd 40)
-
(define ml2fl 8)
-
-
;; inches->cm : number -> number
-
;; to convert inch to cm
-
(define (inches->cm in)
-
(* in2cm in))
-
-
;; feet->inches : number -> number
-
(define (feet->inches ft)
-
(* ft2in ft))
-
-
;; yards->feet : number -> number
-
(define (yards->feet yd)
-
(* yd2ft yd))
-
-
;; rods->yards : number -> number
-
(define (rods->yards rd)
-
(* rd2yd rd))
-
-
;; fulongs->rods : number -> number
-
(define (furlongs->rods fl)
-
(* fl2rd fl))
-
-
;; miles->furlongs : number -> number
-
(define (miles->furlongs ml)
-
(* ml2fl ml))
-
-
-
;; feet->cm : number -> number
-
(define (feet->cm ft)
-
(inches->cm (feet->inches ft)))
-
-
;; test:
-
(feet->cm 1)
-
-
;; yards->cm : number -> number
-
(define (yards->cm yd)
-
(feet->cm (yards->feet yd)))
-
-
;; test:
-
(yards->cm 1)
-
-
;; rods->inches : number -> number
-
(define (rods->inches rd)
-
(feet->inches (yards->feet (rods->yards rd))))
-
;;test
-
(rods->inches 1)
-
-
;; miles->feet: number -> number
-
(define (miles->feet mi)
-
(yards->feet (rods->yards (furlongs->rods (miles->furlongs mi)))))
-
-
;; test
-
(miles->feet 1)
- (* 3 (* 5 (/ 1 2)) 40 8)