Solved

How to determine if a point is on the left or right of a given line

Posted on 2008-10-31
3
1,912 Views
Last Modified: 2013-12-21
Hello,
This is a math / geometry question really.

I am trying to find out if a given coordinate (x0,y0) is on the left or right of a line formed by two other points (x1,y1) and (x2, y2).

I am sure its simple geometry, but if you don't know it, its not so simple :).
0
Comment
Question by:HRCIII
  • 2
3 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 22852095
determine  x =   (y0-y1)(x2-x1)/(y2-y1) + x1

if x < x0 then point is right of line
if x= x0 then point is on line
if x > x0 then point is left of line
0
 

Author Closing Comment

by:HRCIII
ID: 31512130
Thank you,

This works beautifully and saves me a major amount of time.

-HRC
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 22852439
glad I could help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Introduction Many of the most common information processing tasks require sorting data sets.  For example, you may want to find the largest or smallest value in a collection.  Or you may want to order the data set in numeric or alphabetical order. …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now