What is the algorithm for finding the center of a circle from three points?

Here’s my Java port, dodging the error condition when the determinant disappears with a very elegant IllegalArgumentException, my approach to coping with the “points are two far apart” or “points lie on a line” conditions. Also, this computes the radius (and copes with exceptional conditions) which your intersecting-slopes approach will not do. public class CircleThree … Read more

Simplified (or smooth) polygons that contain the original detailed polygon

Edit As of 2013, most links below are not functional anymore. However, I’ve found the cited paper, algorithm included, still available at this (very slow) server. Here you can find a project dealing exactly with your issues. Although it works primarily with an area “filled” by points, you can set it to work with a … Read more

Algorithm to compute a Voronoi diagram on a sphere?

Update in July 2016: Thanks to a number of volunteers (especially Nikolai Nowaczyk and I), there is now far more robust / correct code for handling Voronoi diagrams on the surface of a sphere in Python. This is officially available as scipy.spatial.SphericalVoronoi from version 0.18 of scipy onwards. There’s a working example of usage and … Read more

How to check if line segment intersects a rectangle?

One very simple option would be to use a standard algorithm for checking whether two line segments intersect to check whether the line segments intersects any of the four line segments that make up the corners of the box. It’s computationally very efficient to check if two line segments intersect, so I would expect that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)