Fermat Point(winkervsbecks.github.io)
winkervsbecks.github.io
Fermat Point
http://winkervsbecks.github.io/fermat-point
2 comments
If people have to write Chrome-only code, could they at least put a disclaimer somewhere?
Here here. Also, what possibly could be Chrome-specific here?
After looking into it a bit, I believe the only issue is that the author failed to add an r property to the SVG circles. Apparently Chrome defaults to some non-zero radius, which seems like a poorly-chosen default.
Which means the author just didn't care to try it in any other browser.
After looking into it a bit, I believe the only issue is that the author failed to add an r property to the SVG circles. Apparently Chrome defaults to some non-zero radius, which seems like a poorly-chosen default.
Which means the author just didn't care to try it in any other browser.
My intention wasn't to make something Chrome specific but, I did mess up by not testing in other browsers. Sorry about that.
Turns out that you can't set circle radius in CSS in both Safari and Firefox. For some reason Chrome supports it. Not sure what the correct spec is. In any case it's fixed now.
Turns out that you can't set circle radius in CSS in both Safari and Firefox. For some reason Chrome supports it. Not sure what the correct spec is. In any case it's fixed now.
I could have formulated my criticism more constructively, sorry about that. Just a pet peeve I guess. Thanks for fixing the issue!
Just because you found a bug doesn't mean the author knows about it. Why not leave them a github issue instead of criticizing them here about it?
Agreed.
How does this extend to higher dimensions?
Quick answer: "Triangle" becomes "tetrahedron" in 3 dimensions, and "simplex" in any number of dimensions. There is a notion of "solid angle" that works in any number of dimensions. Then the sum of distances to the vertices of a simplex is minimized (1) by a point inside it from which the solid angles subtended by the faces of the simplex are equal, or (2) at one vertex of the simplex; case 2 holds if the angle subtended at some vertex is >= 1/(n+1) of the "total solid angle" in that many dimensions, otherwise case 1 does.
I suppose I should explain what all that means.
Simplices
A simplex in n-dimensional space consists of n+1 points in general position, together with every convex combination of those points.
"In general position" means they don't all lie in a single hyperplane.
A "hyperplane" means all the points satisfying some linear relationship (strictly, affine rather than linear) between their coordinates. E.g., ax+by+c=0 in two dimensions.
A "convex combination" of x1,...,xk means all points of the form a1.x1 + ... + ak.xk where a1,...,ak are non-negative numbers whose sum is 1. E.g., the convex combinations of two points are exactly the points on the line segment joining those two points.
Solid angles
Suppose you have a point P in n-dimensional space, and some other convex region R in the space. Consider all the rays from P that pass through R; they form a "convex cone" based at that point.
A "convex region" is one such that, if a bunch of points belong to it, so do all convex combinations of those points.
Now, take a (hyper)sphere of radius 1 centred at P and look at the points where those rays meet its surface. The (hyper)area of the set of such points is the solid angle subtended at P by R.
The solid angle subtended at any point by the whole of space equals the (hyper)area of the unit sphere in that space. There is a formula for this but it doesn't matter right now. (When n=2 the "unit hypersphere" is actually a unit circle and "hyperarea" actually means "length"; the figure is 2pi, so we are working in radians. When n=3 it's a unit sphere, "hyperarea" means area, and it's 4pi, so the maximum solid angle you can have is 4pi.)
I suppose I should explain what all that means.
Simplices
A simplex in n-dimensional space consists of n+1 points in general position, together with every convex combination of those points.
"In general position" means they don't all lie in a single hyperplane.
A "hyperplane" means all the points satisfying some linear relationship (strictly, affine rather than linear) between their coordinates. E.g., ax+by+c=0 in two dimensions.
A "convex combination" of x1,...,xk means all points of the form a1.x1 + ... + ak.xk where a1,...,ak are non-negative numbers whose sum is 1. E.g., the convex combinations of two points are exactly the points on the line segment joining those two points.
Solid angles
Suppose you have a point P in n-dimensional space, and some other convex region R in the space. Consider all the rays from P that pass through R; they form a "convex cone" based at that point.
A "convex region" is one such that, if a bunch of points belong to it, so do all convex combinations of those points.
Now, take a (hyper)sphere of radius 1 centred at P and look at the points where those rays meet its surface. The (hyper)area of the set of such points is the solid angle subtended at P by R.
The solid angle subtended at any point by the whole of space equals the (hyper)area of the unit sphere in that space. There is a formula for this but it doesn't matter right now. (When n=2 the "unit hypersphere" is actually a unit circle and "hyperarea" actually means "length"; the figure is 2pi, so we are working in radians. When n=3 it's a unit sphere, "hyperarea" means area, and it's 4pi, so the maximum solid angle you can have is 4pi.)
That's an awesome explanation! I wasn't even aware of "simplex". Guess I'm going to have to add it to my list of things to obsess about.