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 not deleted user 3056

Questions about functionality that defines or operates on regions (i.e., an open, connected set), including geometric, mesh-based, or data and formula-defined regions.

3 votes
Accepted

RegionIntersection of two overlapping lines

Turning my comment into an answer since I guess it's really a sufficient solution to the task at hand... The second answer is also semantically correct, Line can represent a collection of lines. If y …
kirma's user avatar
  • 19.1k
8 votes

Can't find maximum of a function on a region

When you see Element in the variable section of a function such as Maximize, it always means you are dealing with geometric regions, although it is not necessarily immediately obvious. … Values in geometric regions are always vectors, even when that vector has a length of one. So it happens to be in the case of Interval, when it is interpreted to be a region. …
kirma's user avatar
  • 19.1k
6 votes

How to quickly find all grid cells covered by a geometric region?

This answer combines my own code from the question and the idea in @Quantum_Oli's answer. It is already quite much faster than either, at least for polygons: With[{reg = Polygon@RandomReal[{0, 10}, { …
kirma's user avatar
  • 19.1k
5 votes

obtaining random element of a set given by multiple inequalities

It is likely that this method doesn't work for more complicated regions for which Integrate[Boole[...], ...] construct fails to produce meaningful symbolic results. …
kirma's user avatar
  • 19.1k
18 votes
5 answers
892 views

How to quickly find all grid cells covered by a geometric region?

How correct results (preferably for arbitrary regions) could be produced more efficiently? …
kirma's user avatar
  • 19.1k
2 votes

How to quickly find all grid cells covered by a geometric region?

RegionDisjoint[reg, Rectangle[{x, y}]]]]]}]] These methods are usable on other regions too, say reg = Annulus[RandomReal[{-1, 1}, 2], Accumulate@RandomReal[{2, 5}, 2]] …
kirma's user avatar
  • 19.1k
7 votes
Accepted

RegionIntersection for CountryData polygons

In general, GeoPositions and Regions don't mix in Mathematica, and if something like what's mentioned in the quesion works, it's a pure coincidence. … EDIT 2: Actually you can convert these regions which have been operated under a projection back to geographic computation entities, at least if the geometry is not too complex for MeshPrimitives (basically …
kirma's user avatar
  • 19.1k
2 votes

Mesh Split into Cylinder or Cuboid

Given the input polygon is in polygon (with Polygon head), this hack finds approximate lines aligning with cylinders, identifies caps in a bit of an ad hoc manner, and then identifies corresponding cy …
kirma's user avatar
  • 19.1k
5 votes

obtaining random element of a set given by multiple inequalities

Since v10.2 RandomPoint has provided a way to pick uniform samples from geometric regions (which you can trivially derive from your specification using ImplicitRegion): Eta[a_] := {Cos[a], Sin[a]}; NI … It is not particularly hard to construct regions where that doesn't apply. Thankfully it does work on most of simple cases one might explore... …
kirma's user avatar
  • 19.1k
4 votes
Accepted

Simplify behavior: assumption as Interval versus assumption as bounds

Element treats Intervals as geometric regions, and members of those geometric regions are vectors, even when they are of single dimension. … The fact that there are two different interpretations of an Interval - the old, and the new bought by geometric regions functionality - and the fact they're inherently single-dimensional objects causes …
kirma's user avatar
  • 19.1k
5 votes

Find the farthest pairs of two points in 2-dim

This is a variation of @Syed's answer. Distance computation of convex hull boundary points is improved by using DistanceMatrix - which is very well optimised, even if half of the matrix is unnecessary …
kirma's user avatar
  • 19.1k
13 votes
Accepted

How can I find least squares intersection of 3D rays?

EDIT: As @nikie noted, using FindArgMin (a variant of FindMinimum) instead of (N)ArgMin can improve the speed of finding a solution. Since in the case of this problem only one minimum exists, this sho …
kirma's user avatar
  • 19.1k
32 votes
Accepted

Can Mathematica put these puzzle pieces together?

Assuming polygons follow the same (clockwise or counterclockwise) vertex order, find all good quality two line segment rigid mappings between polygons without overlap with each other (at least much ov …
kirma's user avatar
  • 19.1k
2 votes

Controlling quality of discretized region meshes

This answer is not so much about controlling the quality, but pointing out that Mma v13 introduces constructive solid geometry for some basic primitives such as Balls, and is capable of producing much …
kirma's user avatar
  • 19.1k
40 votes
Accepted

How to exactly calculate the volume?

Since discretisation is just numerics the more convoluted implicit regions don't really matter much here. … How these regions are split depend on the orientation of the region, although it's only a difference in rotation... …
kirma's user avatar
  • 19.1k

15 30 50 per page