You must be logged in to post your query.
Home › Forums › Chart Support › how to find a point exist on a line or not
I have two points, lets say x1,y1 and x2,y2. and i have one more point x3,y3, here is the question, i need to check is x3,y3 coordinate occurs in the line between x1,y1 and x2,y2 or not occurs in javascript.
This is line over Canvas, so i want to detect that there is a line or not ?
@prem123,
With the help of Equation of Straight Line, you can detect if a point lies on the line or not. Please take a look at this JSFiddle.
Also, please refer this stackoverflow thread for more info on achieving the same in JavaScript.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register