Questions tagged [computational-geometry]

is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry.

The computational-geometry tag should be assigned to questions about computation and manipulation of locations or properties of geometric identities or objects. Since geometry computations are highly tolerance dependent, definition and computation of tolerances are welcome, too. Sample Questions are: How to compute line-line intersection on 3D? What is the better way of handling geometrical identities as data structures? How to compute volume of a solid? How to deform a solid? How to obtain parametric solids or surfaces?

2743 questions
1
vote
2 answers

Lower Bound of a Curve

I have a curve likes the following: As can be seen, there are two upper bound and lower bound curves on the above (see the following image for the approx visualization!): I have tried to find the lower bound by the following code: lower_bound =…
OmG
  • 18,337
  • 10
  • 57
  • 90
1
vote
2 answers

Find all lines within a circle, for many circles. Optimization

I'm working on a program in which I need to find all lines which are in a circles located at some cartesian point of some radius. At the moment, for every circle, I am iterating over all the lines and checking if the line enters/contacts the circle…
Erik
  • 13
  • 3
1
vote
1 answer

Compute overlap in rectangles, plot result as heatmap

I have a list of rectangles (coordinates as (x0, y0, x1, y1)) that overlap in certain areas. I want to draw them with their overlaps, with an extra twist: the colors of each overlap area should be like a heatmap: they should get darker (or lighter,…
Ludovica
  • 65
  • 6
1
vote
1 answer

Numerically finding the projected area of a bullet

Suppose I have a bullet as shown below where the measurements are in units of bullet diameters (this thing is 3 dimensional, so imagine rotating it about the x axis here) If this bullet were to be tilted upwards by an angle θ, how could I…
Mason
  • 2,981
  • 9
  • 29
1
vote
1 answer

What would be a good mathematical notation for image warping given an image I and transformation T?

I would like to express image transformation (warping) in a mathematical form. For example, image transformation T may be an affine, homography, and so on. Relevant codes might be: # matlab J = imwarp(I, tform); # python opencv J =…
YW P Kwon
  • 2,138
  • 5
  • 23
  • 39
1
vote
0 answers

α-path on Euclidean graphs

Consider the following problem: Suppose we are given a G=(V, E) Euclidean Graph in the plane and a real α > 0. For simplicity assume, there exists only one path whose summation of weights over all edges is equal to α. Give a polynomial decider to…
1
vote
1 answer

Concave Hull implementation

I am trying to implement the algorithm described in the following http://repositorium.sdum.uminho.pt/bitstream/1822/6429/1/ConcaveHull_ACM_MYS.pdf I am using the following class libraries. Loyc libs come from http://core.loyc.net/ using…
pbordeaux
  • 425
  • 1
  • 5
  • 18
1
vote
1 answer

Find the maximum depth of a set of intervals

Given a set of intervals I, each element of the form [a_i, b_i], find an end point b_i of maximum depth in O(n*logn) time. Define depth of x as the number of intervals the point "stabs" (or intersects). If two end point have the same depth, return…
bli00
  • 2,215
  • 2
  • 19
  • 46
1
vote
2 answers

Extracting polygons from a polygon with collinear edges

How can I extract simple polygons out of a polygon which contains collinear edges? For the very simple case below, edge 2-3 and 6-0 are collinear. I want to separate this as 0, 1, 2 and 3, 4, 5, 6. I could compare collinearity of every edge against…
Morrowless
  • 6,856
  • 11
  • 51
  • 81
1
vote
3 answers

Efficient way to find a pair with minimum difference in an array

I'm trying to solve a problem that requires me to find a pair with minimum difference in an array. For example, if the array is 6,7,1,3,9 The output is (6,7) with difference of 1 which is minimum. The fastest solution I can come up with is to…
penguin
  • 1,267
  • 14
  • 27
1
vote
2 answers

Sort points in 2D space to make a spline

I have a sequence of points which are distributed in 2D space. They represent a shape but they are not ordered. So, I can plot them as points to give an idea of the shape, but if I plot the line connecting them, I miss the shape because the order of…
Emanuele
  • 147
  • 1
  • 2
  • 13
1
vote
2 answers

Nearest neighbor searches in non-metric spaces

I would like to know about nearest neighbor search algorithms when working in non-metric spaces? In particular, is there any variant of a kd-tree algorithm in this setting with provable time complexity etc?
1
vote
1 answer

How can I determine the width of the visible side of a 3d box from a centered fixed distance camera?

I have a 2.5d viewport wherein I am trying to express a visualization of the depth of a box with 45 degree 2D lines inwards as if it had no front and you were staring inside from a central point, like this: ------------- | \_______/ | | | |…
emery
  • 55
  • 1
  • 5
1
vote
1 answer

Site Search/Point Location in Voronoi Diagram

Given Voronoi diagram, how to locate which polygon contains query point q? What if q is one of the Voronoi sites, would it make any difference? Do we walk through each polygon and check point-in-polygon? It is too expensive and slow to do that.
Coder
  • 103
  • 7
1
vote
1 answer

How to compute an angle between 2 vectors in a polygon

I implemented a method in javascript to compute the angle between 2 vectors. But I don't know how to compute the angle that lies in the polygon. For example, in this image I want to compute the red angle but in the left one I need to go from AC to…