Created
March 22, 2015 02:16
-
-
Save kouddy/0f5e5510ea83b05cf8e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (make-rect p1 p2) (make-segment p1 p2)) | |
(define (width r) (- (x-point (end-segment r)) (x-point (start-segment r)))) | |
(define (length r) (- (y-point (end-segment r)) (y-point (start-segment r)))) | |
(define (area r) (* (width r) (length r))) | |
(define (perimeter r) (* (+ (width r) (length r)) 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment