• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Geometry problem (slightly OT)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Geometry problem (slightly OT)


  • Subject: Geometry problem (slightly OT)
  • From: Graham Cox <email@hidden>
  • Date: Tue, 21 Sep 2004 23:46:37 +1000

This has got to be straightforward enough, but it's late, I've had an 18 hour day, and I just can't get my head around it...

Given two rectangles lying at arbitrary angles but crossing over one another, how do I calculate the four points of the rhomboid intersection formed? Obviously as the angle becomes closer and closer to 0, the intersection area extends rapidly to infinity... also the 90° case is trivial. It can be assumed that the intersection never includes any corners or ends of the rectangles - in fact they are thick lines that extend far beyond the area of intersection.

The knowns are:

* A single point representing the centre of the intersection - both rects are centred widthwise at this point.
* The angle between the rects and their angles on the plane
* The widths of both rects, which can differ


A page with illustrations very much like what I'm trying to convey here is http://www.cs.unc.edu/~hoff/projects/comp205/proj2/index2.html I need to find the black area's four corners, as in the upper three diagrams.

Incidentally is there anything for finding arbitrary intersections, unions and diffs of paths in Cocoa?

Graham
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Geometry problem (slightly OT)
      • From: Nicko van Someren <email@hidden>
    • Re: Geometry problem (slightly OT)
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: How to validate NSComboBoxCell selection
  • Next by Date: Re: Geometry problem (slightly OT)
  • Previous by thread: Re: Removing everything from a NSView[SOLVED]
  • Next by thread: Re: Geometry problem (slightly OT)
  • Index(es):
    • Date
    • Thread