Questions tagged [line-intersection]

A common problem in is to find the intersection of two lines.

In the common case in two dimensions, the result is a point, which can be expressed as a parameter along one or both of the lines. For rays and line segments, the intersection of the containing lines is computed, then its parameters are checked to see whether the intersection falls within the subset of the line.

Common approaches produce poor answers for lines that are (nearly) parallel, so often an angle test is performed first. Parallel rays and line segments can intersect in a ray or line segment rather than a point.

Special search structures exist for finding intersections among many line segments.

In more than two dimensions, almost all pairs of lines have no intersection, but skew lines can be projected into the unique plane (through the origin) parallel to each. The intersection in that plane identifies the point of closest approach between the lines.

125 questions
0
votes
1 answer

Line intersection code in pascal

I'm trying to write line intersection code to detect if two lines intersect. the form i have stuff in is there are O objects that can have Lo(l subscript O) lines, each line has 2 points and each point has a x and a y. this is the record format. …
Arthur
  • 3,376
  • 11
  • 43
  • 70
0
votes
3 answers

Line Segments Intersection(intersection Point)

I have created a function to calculate the intersection point of two line segment . Unfortunantly the code below dosen't work if one of the segment is verticale public static Point intersection(Segment s1, Segment s2) { double x1 =…
user3521250
  • 115
  • 3
  • 14
0
votes
1 answer

Line intersection without endpoints

I need to determine whether two lines intersect, but these lines have only starting points. (So that's why this is different from similar questions asked about line intersection). The lines are defined as y = dx + a, with d being the gradient. Both…
dcvsu
  • 3
  • 2
0
votes
2 answers

Intersect quadrilateral with axis-aligned rectangle?

How can one efficiently test if an axis-aligned rectangle R intersects a nice quadrilateral Q? Nice means: Q is convex (not a chevron) and non-selfintersecting (not a bowtie, not degenerate). Just 2D. Just yes/no. I don't need the actual region of…
0
votes
1 answer

How to detect intersection of shapes in java?

I would like to know how i can make java detect whether an ellipse is linked to a line or a rectangle and the program should also detect the shape that it is linked to. The ellipse is drawn, a line is also drawn and a rectangle. Java must detect…
Lana
  • 171
  • 1
  • 7
  • 18
0
votes
0 answers

Intersecting Sublayer

I am adding a new layer to the screen. All the layer that are visible are moved to random location based on user input. How to find out if sublayers are intersecting/ overlapping with any other layers? // Move position by certain amount static…
Mike D
  • 25
  • 1
  • 4
0
votes
2 answers

Algorithm to find intersections between straight line

I would like to find all intersections between straight line (infinite). I'm trying change the Bentley-Ottmann algorithm which works for set of line segments, but I have no idea how to represent infinite straight line properly. The first idea was to…
oknais
  • 31
  • 4
0
votes
2 answers

How to pick up line segments which is inside or intersect a circle?

I have sets of line segments AB1, AB2, ... ABn. Each one has (Ax, Ay), (Bx, By) coordinates. Then, I have circle with a center coordinate (Cx, Cy) and r (radius). Problem: How can I detect which line segment lies on a circle (in figure) OR not? . I…
Spider
  • 967
  • 3
  • 14
  • 35
0
votes
1 answer

Parallel polygons intersection detection

Is there an easy way of detecting the intersection of two concave polygons that have all of their sides either parallel or orthogonal to one another?
David
  • 3,075
  • 3
  • 26
  • 36
0
votes
1 answer

Determining intersections of segmented lines

/I need to determine if a pair of lines defined by multiple line segments intersects, for example a line defined by (0,0), (1,2), (3,1) and another by (0,2), (2,-1), (4,1). I do not need to determine where the intersection is, but I need an…
0
votes
0 answers

How to get array of Latlng's from a polyline when intersected by a circle

google maps v3 javascript I have an object that contains an array of all Latlng's within a route (overview_path array) I have a GPS device that is expected to move along that defined route. If this device aparts from the route X meters we can…
0
votes
0 answers

Javascript method to find intersection point of two lines given three points and slopes

I searched for this and found similar answers but they were more math based than programming based, and I need a little help putting it in to code. I have an arbitrary shape, but let's call it a diamond for now, with the following coordinates: A =…
oooyaya
  • 1,773
  • 1
  • 15
  • 39
0
votes
1 answer

Line to Line Intersection In 3d Space

How to find the Line to Line Intersection In 3d Space ? Can anyone give me the equations?
Sakthikannan
  • 463
  • 3
  • 11
  • 17
0
votes
1 answer

Line2D and a JComponent intersection points and affine transformation

Ok I have the line and the component. The component itself is a JPanel. I draw shapes inside it. And adding the shape to the container. This shape can be any polygon. And drawing a curved line (this can be Line2D, CubicCurve2D or QuadCurve2D) in a…
user1326628
-1
votes
1 answer

Finding Coordinates of Line-Line Intersection in C#

to start with I made a simple code that checks if 2 lines collide based on 4 points that are given by their x and y coordinates. It checks if the angle (variable k in my code) of both lines is the same, in that case they are parallel, otherwise they…
HR_Luka
  • 1
  • 1
  • 4
1 2 3
8
9