geometry

Find the closest point to a line from an array of points

Find the closest point to a line from an array of points Question: I have the problem of finding the point which is closest to a line from an array of x- and y-data. The line is semi-infinite originating from the origin at (0,0) and running into the direction of a given angle. The x,y …

Total answers: 2

Algorithm Improvement: Calculate signed change in heading

Algorithm Improvement: Calculate signed change in heading Question: I am trying to implement an algorithm to calculate the signed change in direction between two vectors. Here, I define the signed change in heading to be the smallest angle that needs to be added or subtracted from the angle of a given vector to meet the …

Total answers: 1

Finding the minimum distance from a point to a curve

Finding the minimum distance from a point to a curve Question: I need to find the minimum distance from a point (X,Y) to a curve defined by four coefficients C0, C1, C2, C3 like y = C0 + C1X + C2X^2 + C3X^3 I have used a numerical approach using np.linspace and np.polyval to generate …

Total answers: 2

Middlepoint on circle between 2 points

Middlepoint on circle between 2 points Question: I’m trying to find middlepoint on the circle between 2 points, pictorial drawing There are given radius, p1, p2 and middle of the circle. Distance betweeen p1 and p2 is an diameter, and I’m trying to make up python formula that returns point on the circle between those …

Total answers: 2

Checking if Points In Polygon (State) and Mapping the State

Checking if Points In Polygon (State) and Mapping the State Question: I am trying to map Point data to geographic locations (i.e. US states). I want to create a ‘States’ column by checking if the points fall within certain states using geojson data that has the polygon data in shapely geometry format, and the US …

Total answers: 1

Draw line from every edge of the polygon to opposite vertex

Draw line from every edge of the polygon to opposite vertex Question: I am trying to draw a perpendicular line from every edge to the opposite vertex of a polygon. I am only interested if the line is inside the polygon. Otherwise, I do not want to draw it. I am using the shapely library …

Total answers: 1

Find angle from triangle in python (Similar to using sin-1 on scientific calculators)?

Find angle from triangle in python (Similar to using sin-1 on scientific calculators)? Question: I want to find the angle from a triangle in Python. I searched other topics here but none of them helped me… My code: from math import hypot, sin opposite = 5 adjacent = 8.66 hypotenuse= hypot(opposite, adjacent) # Trigonometry – …

Total answers: 1

Join 2 non-intersecting non-convex Polygons

Join 2 non-intersecting non-convex Polygons Question: these are the 2 polygons to be joined: this is the result needed: how I might approach the problem : Find the projection of polygon B on polygon A , create a convex-hull of polygon B and the projection, and join all using shapely.ops.unary_union(), I don’t know how to …

Total answers: 1

determine if a line segment is within a polygon

determine if a line segment is within a polygon Question: I am trying to find out if a given line segment consisting of two or more points is inside a polygon here is a drawing to help capture the idea: picture to help visualize the problem All I found on the internet was a code …

Total answers: 1