Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

The CRUD Functions CRUD, meaning "Create, Read, Update, Delete (http://en.wikipedia.org/wiki/Create,_read,_update_and_delete)" is a common term to data base developers.  It describes the essential functions of data base table maintenance.  This art…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

19 Experts available now in Live!

Get 1:1 Help Now