126 questions
0
votes
2
answers
182
views
Finding the intersection of two lines a given perpendicular distance from the line of intersection
I'm looking for help to solve the following situation. I have a line segment defined by two points P1 and P2. And I have a ray that starts at P3 and intersects segment P1P2 at P4. I want to calculate ...
0
votes
0
answers
112
views
How can I mimic 'Intersect' arcGIS tool, using geo-spatial packages in python, for large linestring geometry GeoDataFrames?
I have two GeoDataFrames, one is composed of LINESTRINGs ('orig_layer'), and the other of MULTILINESTRINGs ('model_layer'). Both are completely overlap each other - only their line attributes are ...
1
vote
1
answer
49
views
No intersection point found on line with bezier curve: (Using bezier.js by @Pomax)
Code from bezier.js works great for all other examples I've checked.
Except for this one:
const controlPoints = [450,50,300,183,150,150];
const line = { p1: {x: 400, y: 0}, p2: {x: 400, y: 100} }
...
0
votes
0
answers
62
views
Selecting suitable triangles to intersect with a line
Allow me to describe the situation. I have a 3D triangular mesh with N triangles (approx. 1e5 triangles) and M lines (in the same order of magnitude as the triangles but not necessary the same number)....
0
votes
2
answers
161
views
The function cannot detect intersections of two curves
The below source code is supposed to find an intersection between two curves.
However, the function is unable to detect the intersection point.
How can I fix it?
using MathNet.Numerics.Interpolation;
...
0
votes
3
answers
187
views
Large deviation of latitude values for calculating the point of intersection of arcs on a sphere
My task is to find the intersection point of two arcs on the sphere (if it exists). I used algorithm from http://www.boeing-727.com/Data/fly%20odds/distance.html but in some cases the latitude ...
0
votes
1
answer
70
views
Tips for calculating, if a dot is on a curved line and if 2 curved lines intersects
I’d like to program a game in processing (Java) in which the player draws a possibly curved line and next makes a dot on this line. I think, I would draw the line only with pixels, not lines oder ...
0
votes
1
answer
146
views
How does the line-intersection routine in the Greiner-Hormann algorithm work?
As a part of the Greiner-Hormann algorithm for polygon-clipping (described here), there is this subroutine:
In image form:
And transcribed (attempted):
intersect(P1,P2,Q1,Q2,alphaP,alphaQ)
WEC_P1 = ...
0
votes
1
answer
1k
views
Check if two lines are intersecting? (if so, not where so)
I saw this asked but I couldn't understand the answers!
I got 4 vector2s, P1 & P2 for line 1, P3 & P4 for line 2.
Code for intersection position works, but how do I check if that intersection ...
0
votes
0
answers
371
views
3d line intersection with plane
I have two points in my world, P0 and P1 (xyz,..) which basically represent the start of my line and the end of my line. I also have a plane/side with 4 points, ABCD (xyz,..).
What I want to do is ...
0
votes
0
answers
137
views
Calculation of large numbers C++11
I'm trying to find the point where 2 lines intersect.
I am using this example on geeks for geeks.
This works well for small numbers. I am using "accurate" latitude and longitude points which ...
0
votes
1
answer
59
views
How do I fix this JS function so it doesn't return false positives when checking if two line segments intersect?
I'm working on a mapping project (with the Google Maps SDK). Before drawing a line segment on the map I check to see if it intersects with any existing lines.
I'm experiencing a situation where the ...
0
votes
1
answer
276
views
Find intersection of 2 layers containing multiple lines (in python)
I have 2 layers with links and nodes: layer A (yellow) and layer B (blue).
I would like to get the places where the lines of layer A intersect with the lines of layer B (red nodes), directly in python....
0
votes
0
answers
24
views
How to attribute intersection points between poly and lineseg to poly
I'm trying to plot an animal's trajectory from a set of coordinates as a line segment. I want to see how many coordinates are plotted inside a circular zone vs outside. I think that coordinates which ...
1
vote
1
answer
634
views
How to find intersection point between circle and line(2 points) using Mapbox(Turf)
I'm finding how to find intersection point between circle and line(2 points) using Mapbox(Turf).
Turfjs provides "intersect" function but Turf in java doesn't provide that function.
I wonder ...
1
vote
0
answers
740
views
QGIS Line Intersections Plugin does not create a point to some intersection lines
When I use the line intersection plugin in Qgis, it doesn't create whole intersect points. Also, the gif and picture below show that the lines intersect but the plugin doesn't assign any point to them....
0
votes
3
answers
680
views
How to get the angle or vector perpendicular to the bounce angle for 3 points?
I am trying to find the vector or angle in order to calculate the points where two "thick" lines would intersect. The end goal is to draw simple flat planes for a thick line renderer.
...
1
vote
0
answers
1k
views
How to find intersection of lines with opencv
In this picture, I try to fin intersection points between the long white lines between racing lanes and the short perpendicular ones
So to automaticaly obtain the black points as materialized below
...
2
votes
2
answers
4k
views
Intersection of two line segments in Python
Different articles have discussed about the intersection of two line segments in Python such as
How do I compute the intersection point of two lines?,
Numpy and line intersections,
How can I check if ...
-2
votes
1
answer
419
views
XML/KML - How to test if a polygon 'touches' another polygon in a bash script
I am using Google My Maps to map a suburb (as a polygon) on one layer and then on a second layer, all the (rural) properties (also as polygons) that exist in and around that suburb. The polygons are ...
3
votes
2
answers
1k
views
How to calculate the intersection point between an infinite line and a line segment?
Basically, a function that fulfills this signature:
function getLineIntersection(vec2 p0, vec2 direction, vec2 p2, vec2 p3) {
// return a vec2
}
I have looked around at existing solutions, and ...
2
votes
1
answer
214
views
Intersection of hyperbolae in R based on line equations
I am trying to find a method for finding the point of intersection of 2 hyperbolae in R. Single-branch hyperbloae can be described by the following equation:
or
where (xi, yi) and (xj, yj) are the ...
0
votes
1
answer
2k
views
R plotting a line at the intersection of two lines
I have this simple code that plots two intersecting lines:
x <- c(1,2,3,4,5,6)
y2 <- c(6,5,4,3,2,1)
y1 <- c(1,2,3,4,5,6)
plot(x, y1)
plot(x, y1, type="o", col="blue", pch=&...
2
votes
1
answer
2k
views
Finding every point of intersection of multiple lines using pygame in python for creation of game board
I need to find every point of intersection of lines in my code. At these points, I want to put my game pieces. The logic of the game is like that of tic tac toe in which if a player places 3 same ...
0
votes
1
answer
220
views
Efficient algorithm for minimum trace of several line segments
What is the most efficient algorithm for generating a set of line segments that represent the minimum of a group of line segments (see image)?
The resulting line segments should have following ...
-2
votes
3
answers
1k
views
how many line segments will intersect in a plane will intersect with a horizontal line ? what will be the most effective way to find this
I’m trying to solve this Cyberchef challenge:
You are given N points in a plane (numbered 1 through N); for each valid i, the i-th point is Pi=(i,Ai). There are N−1 line segments between them (...
1
vote
1
answer
397
views
How to check if two user-drawn (squiggly) lines intersect?
I'm thinking of making an online version of the game Sprouts, possibly using the JavaScript web browser graphics library p5.js
You can read more about it but basically there are 2 players that draw ...
3
votes
1
answer
1k
views
Finding line intersect using Cramer's rule - Getting incorrect y coordinate
I'm looking to find the intersect of 2 lines using Cramer's rule. This is for an exercise from the book An Introduction To Java Programming (Exercise 3.25 from Chapter 3 and 8.31 from Chapter 8. They ...
1
vote
2
answers
1k
views
Why do we need to homogenise these vectors?
I was looking for a solution for finding the intersection point of two lines. I am aware that this can be done by finding their vector product.
I stumbled upon this example here:
Numpy and line ...
2
votes
1
answer
264
views
How to find intersection point of opposite lines of two lines
I am trying to find intersection point of opposite lines of two lines:
var ax=0.00, ay=0.50 ;
var bx=1.00, by=1.00 ;
var cx=2.00, cy=0.25 ;
But I am very confused about finding an opposite of a line.
...
0
votes
1
answer
449
views
Check if square intersects line in JavaScript
Given the position and dimensions of a square, what is the equation in JavaScript for testing if a line goes through the rectangle?
What I have tried so far is:
function isSquareIntersectingLine(...
3
votes
1
answer
5k
views
How to calculate ray-line segment intersection preferably in OpenCV? And get its intersection points and distance from origin?
I have 4 lines segment, A, B, C and D. Each line is represented as two points. Eg. line A is represented as point A1 and point A2.
What I want is
point X, which is the point where line A ray ...
1
vote
0
answers
603
views
Sweep-line algorithm with circle intersections
I'm trying to implement the sweep line algorithm for circle intersections in which an intersection occurs iff the euclidean distance between the circles' origins are <= the sum of both radii. (...
0
votes
1
answer
2k
views
Line and rectangle intersection
I have a rectangle and a line segment inside the rectangle, and the line can be extended on both sides. I know the coordinates of the rectangle's four vertices as well as the line's two vertices.
I ...
2
votes
1
answer
2k
views
Using shapely to return co ordinates of multilinestring that intersect
I've generated random streets using Shapely's LineString function using the following code:
class StreetNetwork():
def __init__(self):
self.street_coords = []
self.coords = {}
def ...
2
votes
1
answer
171
views
Finding intersections of curves that cannot be represented as y=f(x)
I have two pairs of data sets, x1 vs y1 and x2 vs y2. x1, y1, x2, y2 all have uneven distribution of data represented by the following images:
My problem is to determine the intersection of the two ...
1
vote
1
answer
357
views
Linear expression for intersection length of two lines in 1D
Given the first line from a to b where a < b and the second line from x to y where x < y, how do you calculate the intersection length of those two?
Example:
a =0, b=5, x=3, y=7
012345
|----...
0
votes
1
answer
391
views
Finding an intersection on Matlab
I have two sets of data curves, x1,y1 and x1,y2.
I wish to find the intersection between these two curves. However, I do not have the equation for x1,y1. Moreover, when using traditionnal intersection ...
6
votes
0
answers
1k
views
determine whether line intersects other lines on google map
I know there are various discussions on SO about line intersections and the math behind it. I am familiar with the math.
This post nicely explains an algorithm one can implement: Determine if two ...
0
votes
1
answer
383
views
3D vectors intersection using weighted least squares approach
I want to find the closest intersection point to multiple lines/vectors in 3D space but I want to weight the influence of each vector based on its length (the greater its length, the greater its ...
-2
votes
1
answer
669
views
Test is two lines are intersecting [closed]
So this question already has many answers but i was not able to find one for my specific problem. I have a very special case with only positive integers where always a line has always either the same ...
1
vote
1
answer
2k
views
Pandas columns line intersection
I've got a pandas dataframe where each column represents the y values of a descending line from 1 to 0 and the indexes represent the x values. Now I'm interested in finding the intersection points ...
1
vote
4
answers
1k
views
Calculation of shape width at given horizontal line
Let's say I have such a polygon
public partial class Window2 : Window
{
public Window2()
{
InitializeComponent();
var myPolygon = new Polygon();
myPolygon.Stroke = ...
0
votes
0
answers
496
views
GPS lap & Segment timer
I've been searching for a while but haven't found exactly what I'm looking for.
I'm working on an app that will go in a race car. It will give the driver the ability to press a button to mark a ...
1
vote
1
answer
1k
views
what is an good way to define a bounded plane to make line intersections easy?
I want to define a bounded plane, ie a rectangle in 3d space. I realize it could be defined just by declaring its 4 vertices, but I will be using a line intersection algorithm many times on this shape ...
1
vote
0
answers
380
views
How to untangle graph as much as possible?
I wrote a short directed graph viewer that generates random nodes and random directed relationships between nodes and presents them on screen.
The nodes are currently positioned sequentially as a ...
1
vote
1
answer
62
views
Planarity Model for intersecting lines
I'm looking at the Planarity model's "crossed?" method from the Models Library in order to determine if two lines are intersecting.
This model seems to be working for the most part; however, there ...
0
votes
1
answer
388
views
Sql two line intersection
I'm working on a geo project and have some question about that. I draw line with latitude longitude data like the picture below. 1,2,3 are the position I get from db. I want to draw line on that route ...
14
votes
4
answers
32k
views
Intersection between line and triangle in 3D
I have a line and a triangle somewhere in 3D space. In other words, I have 3 points ([x,y,z] each) for the triangle, and two points (also [x,y,z]) for the line.
I need to figure out a way, hopefully ...
5
votes
4
answers
9k
views
Finding intersections of a skeletonised image in python opencv
I have a skeletonised image (shown below).
I would like to get the intersections of the lines. I have tried the following method below, skeleton is a openCV image and the algorithm returns a list of ...