CTK Exchange
Front Page
Movie shortcuts
Personal info
Awards
Reciprocal links
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sit's
Guest book
News sit's

Manifesto: what CTK is about |Store| Search CTK Buying a book is a commitment to learning Table of content Things you can find on CTK Chronology of updates Email to Cut The Knot

CTK Exchange

Subject: "Two rectangles, do they intersect?"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange This and that Topic #64
Reading Topic #64
Conan K Woods (Guest)
guest
Jan-01-01, 07:11 PM (EST)
 
"Two rectangles, do they intersect?"
 
   Hi, I have a math problem I have to solve for a computer program I am writing. I have two rectangles, and I need an algorithm to see if at any point the two rectangles intersect. I have the x and y values of all the points of each rectangle. Is their a fast and easy way to do this?

woodsc@f00f.net


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
alexb
Charter Member
672 posts
Jan-01-01, 07:16 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
1. "RE: Two rectangles, do they intersect?"
In response to message #0
 
   Assume you want to establish whether two infinite horizontal strips intersect or not. What would you do?

Assume for one of them a <= y <= a + A, for the other
b <= y <= b + B. When do they intersect?

A similar question for a couple of infinite strips is solved
analogously.

Now note that every rectangle is an intersection of two infinite strips: one horizontal, the other vertical.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top

Conferences | Forums | Topics | Previous Topic | Next Topic

You may be curious to visit the old CTK Exchange archive.

|Front page| |Contents|

Copyright © 1996-2018 Alexander Bogomolny

[an error occurred while processing this directive]
 Advertise

New Books
Second editions of J. Conway's classic On Numbers And Games and the inimitable Winning Ways for Your Mathematical Plays