Solved

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

Posted on 2008-10-31
3
1,921 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

821 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