Difference between quadtree and kd-tree

The difference (algorithmically) is: in quadtrees, the data reaching a node is split into a fixed (2^d), equal size cells, whereas in kdtrees, the data is split into two regions based on some data analysis (e.g. the median of some coordinate). Quadtrees do not scale well to high dimensions, due to the exponential dependency in … Read more

Determine non-convex hull of collection of line segments

Pick a safe starting point. Can be e.g. the endpoint with maximum x. March along the line segment. Upon encountering any intersection, always turn left and march along this new segment. Upon encountering an endpoint, record it. Goto 2. Stop when you have returned to your starting point. Your list of recorded endpoints now makes … Read more

How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?

The Voronoi diagram is just the dual graph of the Delaunay triangulation. So, the edges of the Voronoi diagram are along the perpendicular bisectors of the edges of the Delaunay triangulation, so compute those lines. Then, compute the vertices of the Voronoi diagram by finding the intersections of adjacent edges. Finally, the edges are then … Read more

Mathematically producing sphere-shaped hexagonal grid

The shape you have is one of so called “Goldberg polyhedra”, is also a geodesic polyhedra. The (rather elegant) algorithm to generate this (and many many more) can be succinctly encoded in something called a Conway Polyhedron Notation. The construction is easy to follow step by step, you can click the images below to get … Read more

Maximum possible number of rectangles that can be crossed with a single straight line

Here is a sketch of an O(n^2 log n) solution. First, the preliminaries shared with other answers. When we have a line passing through some rectangles, we can translate it to any of the two sides until it passes through a corner of some rectangle. After that, we fix that corner as the center of … Read more

How to calculate inverse kinematics [closed]

The following resources survey some popular numerical methods for inverse kinematics problems: Samuel R. Buss. Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares methods Bill Baxter. Fast Numerical Methods for Inverse Kinematics Chris Welman. Inverse Kinematics and Geometric Constraints for Articulated Figure Manipulation Buss’s survey may be particularly interesting, because it … Read more

tech