Solved

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

Posted on 2008-10-31
3
1,932 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 74

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 74

Expert Comment

by:sdstuber
ID: 22852439
glad I could help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 This question got me thinking... (http://www.experts-exchange.com/questions/28707487/GLOBALS.html) Why shouldn't we use Globals? This is a simple question without a simple answer.  How do you explain these concepts to a programmer w…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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