computational-geometry

Search in locality sensitive hashing

二次信任 提交于 2019-11-29 15:42:53
I'm trying to understand the section 5. of this paper about LSH, in particular how to bucket the generated hashes. Quoting the linked paper: Given bit vectors consisting of d bits each, we choose N = O(n 1/(1+epsilon) ) random permutations of the bits. For each random permutation σ, we maintain a sorted order O σ of the bit vectors, in lexicographic order of the bits permuted by σ. Given a query bit vector q, we find the approximate nearest neighbor by doing the following: For each permu- tation σ, we perform a binary search on O σ to locate the two bit vectors closest to q (in the

Validity of algorithm for creation of a non self-intersecting polygon

烈酒焚心 提交于 2019-11-29 15:25:43
问题 As an extension and partial answer to my thread I wrote a simple algorithm that given a set of points(with xy coordinates) can form a non self-intersecting polygon. Claim: Given an arbitrary set of points with different coordinates it is always possible to construct a regular or irregular, non self-intersecting polygon. The algorithm: Assume there is a set V containing all the vertices 1) Sort all vertices in V by x-coordinate 2) Imagine a straight line (we'll call that "the divider")

Java: plot points based on distances

故事扮演 提交于 2019-11-29 12:59:38
I need to plot a group of points based on distances. I have three unknown points X, Y, and Z. I then get another unknown point (A) and its distances from the originals (AX, AY, AZ). I will continue getting points and distances (B, BX, BY, BZ; C, CX, CY, CZ) etc. My question is whether its possible to plot all of the points. If so, how many points would I need for an exact plot map? What about an approximate map? This is similar to this question but I get a different set of distances and am not limited to the original number of points. Also, if it would help I could add more points to the X, Y,

Approximate a curve with a limited number of line segments and arcs of circles

二次信任 提交于 2019-11-29 11:49:05
Is there any algorithm that would allow to approximate a path on the x-y plane (i.e. an ordered suite of points defined by x and y) with a limited number of line segments and arcs of circles (constant curvature)? The resulting curve needs to be C1 (continuity of slope). The maximum number or segments and arcs could be a parameter. An additional interesting constraint would be to prevent two consecutive circles of arcs without an intermediate line segment joining them. I do not see any way to do this, and I do not think that there exists a method for it, but any hint towards this objective is

How do I get three non-colinear points on a plane? - C++

六眼飞鱼酱① 提交于 2019-11-29 10:24:25
问题 I'm trying to implement at line-plane intersection algorithm. According to Wikipedia I need three non-colinear points on the plane to do that. I therefore tried implementing this algorithm in C++, however. Something is definitely wrong, cause it makes no sense that I can choose whatever x and y coordinates and they'll fit in the plane. What if the plane is vertical and along the x-axis? No point with y=1 would then be in the plane. I realize that this problem has been posted a lot on

Determine the position of a point in 3D space given the distance to N points with known coordinates

纵然是瞬间 提交于 2019-11-29 10:22:12
问题 I am trying to determine the (x,y,z) coordinates of a point p. What I have are the distances to 4 different points m1, m2, m3, m4 with known coordinates. In detail: what I have is the coordinates of 4 points (m1,m2,m3,m4) and they are not in the same plane: m1: (x1,y1,z1), m2: (x2,y2,z2), m3: (x3,y3,z3), m4: (x4,y4,z4) and the Euclidean distances form m1->p, m2->p, m3->p and m4->p which are D1 = sqrt( (x-x1)^2 + (y-y1)^2 + (z-z1)^2); D2 = sqrt( (x-x2)^2 + (y-y2)^2 + (z-z2)^2); D3 = sqrt( (x

Trilateration in a 2D plane with signal strengths

扶醉桌前 提交于 2019-11-29 09:32:59
问题 first question to StackOverflow, please be gentle. I am trying to find the equation (and then the algorithm for) the center point of three different points on a 2D cartesian plane, given a certain magnitude or "signal strength". These signal strengths are all on a scale relative to each other, but shouldn't necessary be conflated with "radius" of a circle. Wikipedia entry on trilateration: http://en.wikipedia.org/wiki/Trilateration I've also checked out this thread, but it's a little

Get the Surface Area of a Polyhedron (3D object)

房东的猫 提交于 2019-11-29 09:29:40
I have a 3D surface, (think about the xy plane). The plane can be slanted. (think about a slope road). Given a list of 3D coordinates that define the surface( Point3D1X , Point3D1Y , Point3D1Z , Point3D12X , Point3D2Y , Point3D2Z , Point3D3X , Point3D3Y , Point3D3Z , and so on), how to calculate the area of the surface? Note that my question here is analogous to finding area in 2D plane. In 2D plane we have a list of points that defines a polygon, and using this list of points we can find the area of the polygon. Now assuming that all these points have z values in such a way that they are

Given a set of polygons and a series of points, find the which polygons are the points located

為{幸葍}努か 提交于 2019-11-29 07:36:09
This is a question similar to the one here , but I figure that it would be helpful if I can recast it in a more general terms. I have a set of polygons, these polygons can touch one another, overlap and can take on any shape. My question is, given a list of points, how to devise an efficient algorithm that find which polygons are the points located? One of the interesting restriction of the location of the points is that, all the points are located at the edges of the polygons, if this helps. I understand that r-trees can help , but given that I am doing a series of points, is there a more

Boolean Operations on SVG paths [closed]

醉酒当歌 提交于 2019-11-29 06:03:23
As of early 2014, SVG spec does not have any built-in support for Boolean Operations Boolean operations are methods for altering the inherent geometry of mostly overlapping paths. They allow the construction of complicated shapes by performing operations on simpler shapes and are somehow similar to Constructive Solid Geometry(CSG) . However this question refers to 2D vector paths. The popular path operations are: Union, Substraction,Intersection, XOR(Exclusive Or). Are there any libraries floating around that would help me out in this? There's Javascript Clipper , which allows for all the sets