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:
parent
a799985951
commit
48bed65e17
|
@ -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")
|
||||
|
||||
|
|
12
collects/drracket/private/rectangle-intersect.rkt
Normal file
12
collects/drracket/private/rectangle-intersect.rkt
Normal 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)))
|
Loading…
Reference in New Issue
Block a user