
Shortest distance between a point and a line segment
EDIT: My line segment is defined by two endpoints. So my line segment AB is defined by the two points A (x1,y1) and B (x2,y2). I'm trying to find the distance between this line segment and a point C …
Shortest distance between two line segments - Stack Overflow
May 13, 2010 · I need a function to find the shortest distance between two line segments. A line segment is defined by two endpoints. So for example one of my line segments (AB) would be defined …
Circle line-segment collision detection algorithm? - Stack Overflow
Jul 2, 2009 · I have a line from A to B and a circle positioned at C with the radius R. What is a good algorithm to use to check whether the line intersects the circle? And at what coordinate along the …
How do you detect where two line segments intersect? [closed]
Feb 19, 2009 · Question A: Where do two line segments intersect? You know that two line segments a and b intersect. If you don't know that, check it with the tools I gave you in "Question C". Now you …
c# - Find if point lies on line segment - Stack Overflow
Aug 13, 2011 · Find the distance of point P from both the line end points A, B. If AB = AP + PB, then P lies on the line segment AB.
How do I calculate the normal vector of a line segment?
Apr 26, 2014 · Suppose I have a line segment going from (x1,y1) to (x2,y2). How do I calculate the normal vector perpendicular to the line? I can find lots of stuff about doing this for planes in 3D, but …
Perpendicular on a line from a given point - Stack Overflow
Jul 21, 2016 · How can I draw a perpendicular on a line segment from a given point? My line segment is defined as (x1, y1), (x2, y2), If I draw a perpendicular from a point (x3,y3) and it meets to line on …
Join multiple line segments into one line - GIS - Stack Overflow
Jul 21, 2013 · This will merge them all into one segment. Then you can export the nodes (regular only), this being the points of intersection. Then you can split the dissolved line feature with the nodes. This …
Plotting numerous disconnected line segments with different colors
In general, any two line segments are disconnected (meaning that their end-points do not necessarily coincide). How to plot this data using matplotlib with a single plot call (or as few as possible) as there …
Testing whether a line segment intersects a sphere
Nov 7, 2011 · I am trying to determine whether a line segment (i.e. between two points) intersects a sphere. I am not interested in the position of the intersection, just whether or not the segment …