Tag Info

New answers tagged

4

Here are a few more thoughts: When you run this through DiscretizeGraphics you get a message about degenerate cells: DiscretizeGraphics[Polygon[data]]; MeshRegion::dgcell: "The cell Polygon[{39,40,39,41}] is degenerate." As noted scaling helps: mr = DiscretizeGraphics[Polygon[data.DiagonalMatrix[{1, 1000}]]] You can use the Finite Element mesher and ...


6

The polygon is very thin. If we scale the points so that the polygon is of good proportions Area works. GraphicsRow[{ Graphics[{Red, Polygon[pts]}], Graphics[{Red, Polygon[pts.DiagonalMatrix[{1, 1000}]]}]}, Frame -> All] Area[Polygon[pts.DiagonalMatrix[{1, 1000}]]]/1000 (* 2018.48 *) One might suppose that round-off error causes the failure ...


8

Yes, this is a bug in the more general function RegionMeasure. I knew there were some edge cases in the handling of inexact numberics, but I was unaware of such a simple example. I will forward this bug internally. Workarounds include using the parametric (2-argument) form of ArcLength, and using DiscretizeRegion to preprocess regions before sending them ...


6

---EDIT--- @MichaelE2 is right in that it isn't the overlap (or at least not just the overlap) that is to blame. However, it's not just the scaling of the fast dimension either. You can see that if you resample the data by adding another point. Then Area calculates this just fine! data2[n_] := Transpose[ArrayResample[#, n] & /@ Transpose[data]]; so ...


1

This is just an extended comment. The corners that you used to define the Cuboid do not define a valid region. While Cuboid[{2, -2, -1}, {-2, 2, 3}] and Cuboid[{-2, -2, -1}, {2, 2, 3}] fill the same space, Mathematica only considers the second Cuboid to be a valid region. RegionQ /@ { Cuboid[{2, -2, -1}, {-2, 2, 3}], Cuboid[{-2, -2, -1}, {2, 2, 3}]} ...


2

p2 = Animate[Show[{ RegionPlot3D[ And[-2 < x < 2, -2 < y < 2, -1 < z < 3, z - t y - t x < 0], {x, -4, 4}, {y, -4, 4}, {z, -4, 4} ], ContourPlot3D[{z - t y - t x == 0}, {x, -3, 3}, {y, -3, 3}, {z, -7, 7}, MeshFunctions -> {Function[{x, y, z, f}, x^2 + y^2 - r^2 - z + t y + t x]}, Mesh ...


2

Ignoring Stephen's marketing hype, it's important to recognize that the RPi distribution is stripped down a bit so that it can be bundled onto the computer (I think the latest version is 400 MB). This issue was more recently addressed with the Sunrise and Sunset functions over at Wolfram Community: Yes. We strive to keep the Raspberry Pi distribution as ...


2

V(p1)⊂V(p2)iff the radical of the ideal (p2) contains that of (p1). These radicals are, for principal ideals, generated by the squarefree factors of the respective generating polynomials. The intersection can be found using a construct like Solve[{p1==0,p2==0},vars]. If instead you want the ideal intersection, that can be found by a GroebnerBasis ...


1

The following approach will address the requirement Areas where the histogram is more than some threshold value... asamjson = Import["http://msi.nga.mil/MSI_JWS/ASAM_JSON/getJSON?typename=\ DateRange_AllRefNumbers&fromDate=19900101&toDate=20140801", "JSON"]; Needs["GeneralUtilities`"] asamdataset = Dataset[ToAssociations@asamjson]; asamdataset = ...


5

The approach to address the encircling areas will be using the Graph fucntionality available in Mathematica. There are some null values in the dataset so we'll remove them in the new dataset piracyLocations. asamjson = Import["http://msi.nga.mil/MSI_JWS/ASAM_JSON/getJSON?typename=\ DateRange_AllRefNumbers&fromDate=19900101&toDate=20140801", ...


1

Well, since you bragged about computing power... Clear@findIntersections; findIntersections[polyGroup__] := Module[{reg}, reg = RegionIntersection[ Sequence @@ DiscretizeRegion[#, PerformanceGoal -> "Quality", Method -> "DiscretizeGraphics", AccuracyGoal -> 10, PrecisionGoal -> 10] & /@ polygons[[polyGroup]]]; ...



Top 50 recent answers are included