pulled rectangle-intersect? out into its

own file so it can be reused (in some code
that I've not yet pushed)
This commit is contained in:
Robby Findler 2012-08-10 13:46:53 -05:00
parent a799985951
commit 48bed65e17
2 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,8 @@
"drsig.rkt"
"rep.rkt"
"eval-helpers.rkt"
"local-member-names.rkt")
"local-member-names.rkt"
"rectangle-intersect.rkt")
(define-runtime-path expanding-place.rkt "expanding-place.rkt")

View File

@ -0,0 +1,12 @@
#lang racket/base
(provide rectangles-intersect?)
(define (rectangles-intersect? l1 t1 r1 b1 l2 t2 r2 b2)
(or (point-in-rectangle? l1 t1 l2 t2 r2 b2)
(point-in-rectangle? r1 t1 l2 t2 r2 b2)
(point-in-rectangle? l1 b1 l2 t2 r2 b2)
(point-in-rectangle? r1 b1 l2 t2 r2 b2)))
(define (point-in-rectangle? x y l t r b)
(and (<= l x r)
(<= t y b)))