• 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: Math help.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Math help.


  • Subject: Re: Math help.
  • From: Emmanuel <email@hidden>
  • Date: Fri, 16 Feb 2001 07:47:09 +0100

At 2:47 +0100 16/02/01, Brad Giesbrecht wrote:
>Hello list,
>
>Can I get right at it?
>
>Ok, I have grid coordinate's that make up a rectangle
>and a center.
>

>Now, what is the argument to determine if
>this_item {x, y} coordinate's fall in top_area,
>right_area, bottom_area, or left_area.

You need test whether this_item is "above" or "below" each of the two
diagonals.

Two aboves -> top_area, above first and below second -> right_area etc.

To test whether a given (x,y) is above or below the line joining two given
points (x1,y1) and (x2,y2), compute:

(y-y1)-(x-x1)*(y2-y1)/(x2-x1)

If this is > 0 (for instance, for x=0 and y very large) then (x,y) is above.
If this is < 0 (for instance, for x=0 and y very negative) then (x,y) is below.

HTH
Emmanuel


References: 
 >Math help. (From: Brad Giesbrecht <email@hidden>)

  • Prev by Date: RE: Finder Windows - Manipulating List View Columns
  • Next by Date: Re: Finder Windows - Manipulating List View Columns
  • Previous by thread: Math help.
  • Next by thread: Reference finder windows to specific screen?
  • Index(es):
    • Date
    • Thread