Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 51

Questions on constructing graphical objects using relatively complex computations relating to the mathematical structures defining those objects. Examples include convex hulls, Voronoi diagrams, Delaunay triangulations, mathematical constructions, symmetries, genuses of curves and graphs and programmatic constructions of polyhedra.

13 votes

Find the nearest locations for multiple points

I will crib shamelessly from example and code for illustrating by @ybeltukov. The example: n = {5, 5}; holes = N@Tuples@Range@n; balls = RandomReal[{0, # + 1}, Times @@ n] & /@ n // Transpose; We …
Daniel Lichtblau's user avatar
21 votes

Computing the genus of an algebraic curve

I will show a method that is conjectural, though i believe it is correct. It differs from the more common approach of using (quadratic) birational transformations to force singularities to be double p …
Daniel Lichtblau's user avatar
16 votes

Insphere for Irregular Tetrahedron

This may not be as neat as the other methods posted. About the only things I can say are that it is derived from basic principles, and it is fortunate that I had my hair buzzed rather short a few days …
Daniel Lichtblau's user avatar
17 votes
Accepted

Determine whether points lie within a cow

This is basically a rehash of code I posted in a prior thread on this topic. The underlying method is to shoot a ray from the point and see how many surface triangles it intersects. elsie = ExampleDa …
Daniel Lichtblau's user avatar
3 votes

How to efficiently implement k-FN (k-Furthest Neighbors)?

Not necessarily best of quality but maybe could be made better with a bit of tuning. kDistant[pts_List, n_] := Module[ {objfun, len = Length[pts], ords, a, c1}, ords = Array[a, n]; c1 = Flatten …
Daniel Lichtblau's user avatar
6 votes

Approximating Voronoi diagram without any distance checks

Here is a method that combines usage of "fast marching" and Nearest from responses here. It is not as pretty as the one shown here but is probably more efficient computationally. The idea is to work o …
Daniel Lichtblau's user avatar
9 votes

Distances between points in periodic cube

You want something like PeriodicDistance[pts_, size_: 1] := Outer[EuclideanDistance, size*FractionalPart[pts/size], size*FractionalPart[pts/size], 1] But what you did is a bit different in ter …
Daniel Lichtblau's user avatar
0 votes
Accepted

Finding a set of characteristics of a system of polynomial equations

This is a bit of a wild guess, based on two articles sent by the poster (references below). First rewrite the system using lower case names, making the N into a time-dependent "input" variable, and c …
Daniel Lichtblau's user avatar
18 votes

How to check if a 2D point is in a polygon?

Since someone dragged in Canada... Here is the code from a MathGroup post I had referenced. I have modified to compile to C and that speeds it further. The one-off preprocessing does take time but it …
Daniel Lichtblau's user avatar
4 votes

Place spheres randomly in a box without collisions?

Okay, here goes. Given a distro, box length, and number of desired points one can generate a bunch more, remove the ones that are too close to the edges to fit, then iterate through what remains to d …
Daniel Lichtblau's user avatar
3 votes

Help finding the point(s) inside "non-star" closed shape with the highest average ray length?

One approach is to parametrize the boundary, and use that parametization for the innermost integral that defines the averaged radius. This might or might not correspond to the definition you have in m …
Daniel Lichtblau's user avatar
4 votes

Simplifying an expression to a sensible conic section polynomial

This is not a general-purpose answer but it works in this case at least. First step is to obtain an implicit polynomial in {x,y} for that second expression. Often enough, GroebnerBasis can do this. It …
Daniel Lichtblau's user avatar
3 votes

Generate convex-hull of a 15 dimensional space

Start with the definition (I use Together to make it somewhat shorter). func = {1/225 (-15 x5^2 y1^2 - 15 x6^2 y1^2 - 15 x5^2 y2^2 - 15 x6^2 y2^2 - 5 Sqrt[15] x2 x5 y3^2 - 25 x5^2 y3^2 + 5 Sqrt[ …
Daniel Lichtblau's user avatar
16 votes

Voronoi diagrams for generators other than points

While I cannot match @whuber's simple elegance, I will show a bit of brutishness by using Fast Marching from scratch. This finds distances from a specified boundary. I'll modify it so that, for each p …
Daniel Lichtblau's user avatar
21 votes

Voronoi diagrams for generators other than points

Here is a Nearest-based method. This is quite similar to what @Mr. Wizard did for approximating 3D (ordinary) Voronoi. comps = MorphologicalComponents[img]; cmap = Flatten[MapIndexed[#2 -> # …
Daniel Lichtblau's user avatar

15 30 50 per page