Tagged Questions
6
votes
1answer
78 views
rule-based implementation of an algorithm
When I first started learning about rule-based programming with Mathematica, I tried to translate this algorithm for computing the convex hull of a set of 2-D points in O(n Log(n)), to use rule-based ...
18
votes
5answers
594 views
Voronoi diagrams for generators other than points
Any suggestions how to determine Voronoi diagram for sites other than points, as e.g. in the picture below? Input is a raster image.
5
votes
3answers
275 views
How to ensure that Polygon[list] plots a simple polygon?
Consider the following code which plots a triangle.
p = {{0, 0}, {.2, 0}, {0, .2}};
{Cyan, Polygon[Dynamic[p]]} // Graphics
Then adding (for example) ...
34
votes
8answers
4k views
How to check if a 2D point is in a polygon?
Background: I use code from An Efficient Test For A Point To Be In A Convex Polygon Wolfram Demonstration to check if a point ( mouse pointer ) is in a ( convex ) polygon. Clearly this code fails for ...
1
vote
1answer
200 views
Code to draw geometry doesn't run
I'm new to Mathematica and have no background whatsoever in programming, although I will teach myself soon. I was wondering if one of you programming pros could help me out. I received a code from ...