• 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
Re: Geometry problem (slightly OT)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Geometry problem (slightly OT)


  • Subject: Re: Geometry problem (slightly OT)
  • From: Nicko van Someren <email@hidden>
  • Date: Tue, 21 Sep 2004 16:30:07 +0100

On 21 Sep 2004, at 15:59, Graham Cox wrote:

On 22 Sep 2004, at 12:26 am, Nicko van Someren wrote:

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

This is easy. Given the way you have described the rectangles they can each be considered to consist of two parallel sides which are important and two ends which are unimportant. If the first rectangle has important sides A and B and the second has important sides C and D then the vertices of your rhomboid are the intersection point AC, AD, BC and BD.


Yes, this is easy ;) However, they aren't really rectangles, they're lines that go off for a long way and in fact are part of a curve, but in the local intersection area they can be considered to be rectangles. Given this, I don't have the points A B C and D, I only have the specific information listed above. Generating the points A B C D from this information is as difficult as the solution I'm looking for it seems.

OK, it seems odd that you only have angles rather than vectors for the line, but if that's the case it's still fairly easy.


Reset the origin to the intersection point; we'll add it back in later.
Your lines have a thickness of W1 and W2 respectively and angles a1 and a2 relative to the X axis.
V1 and V2 represent the vectors from the middle of each line to the edge:
V1 = { -0.5 * W1 * sin(a1), 0.5 * W1 * cos(a1) }
V2 = { -0.5 * W2 * sin(a2), 0.5 * W2 * cos(a2) }
In co-ordinates centred on the intersection the vertices of the rhomboid are:
V1+V2, V1-V2, -V1+V2, -V1-V2
Adjust these by adding back the intersection point to get your final points.


	Nicko

_______________________________________________
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


References: 
 >Geometry problem (slightly OT) (From: Graham Cox <email@hidden>)
 >Re: Geometry problem (slightly OT) (From: Nicko van Someren <email@hidden>)
 >Re: Geometry problem (slightly OT) (From: Graham Cox <email@hidden>)

  • Prev by Date: Keycodes for non-ASCII keys
  • Next by Date: Re: User Picture
  • Previous by thread: Re: Geometry problem (slightly OT)
  • Next by thread: Keycodes for non-ASCII keys
  • Index(es):
    • Date
    • Thread