New answers tagged

0

One big obstacle with your data is that it can't be defined as a single-valued function of x - it curves backward at the end. If I take your data and define it as pts, then we can see what we are going for here Show[ RegionPlot[ ImplicitRegion[ Sqrt[x^2 + y^2] == 0.99, {{x, 0.01, 0.99}, {y, 0.01, 0.99}}]], Graphics@Line@pts] The trick I'll use ...


5

As you say in your post, for some cases, RegionIntersection is able to return a Graphics primitive RegionIntersection[Disk[iwork, 4], Polygon@r1] (* DiskSegment[{1, 4}, 4, {π + ArcTan[Sqrt[15]], 3 π - ArcTan[Sqrt[15]]}] *) to which you can simply apply Graphics and get a visual result. This is not the general case. If you took those regions and ...


3

Here is some code I have for making fake Voronoi diagrams, adapted to the Poincaré disk model. The result has the look and feel of having been drawn with a charcoal pencil, which may or may not be desired for your application. The strategy is adapted from suggestions by Worley and Schlick. (* some points *) BlockRandom[SeedRandom[42, Method -> ...


6

EDIT (incorporating comments by @J.M.: DistanceFunction->dis and pre-computation of nearest function): This is not efficient. Just rewriting metric (apologies for errors). In the following I used ContourPlot but DensityPlot could be used. dis[a_, b_] := Abs[ArcCosh[1 + 2 ( a - b).(a - b)/((1 - a.a) (1 - b.b))]] vh[n_] := Module[{p = ...


0

For the cited problem: Integrate[ If[Abs[x] + Abs[y] + Abs[z] < 4, 1, 0], {x, -4, 4}, {y, -4, 4}, {z, -4, 4}] (* 256/3 *) RegionPlot3D[Abs[x] + Abs[y] + Abs[z] < 4, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, PlotPoints -> 50] For this problem: Integrate[ If[(y - 1/2) - (x + t) > 0 && x - y > 0, ...


5

You need to be consistent with the order of the variables defining the region: region = ImplicitRegion[{(y - 1/2) - (x + t) > 0, x - y > 0}, {{x, -1, 1}, {t, -1, 1}, {y, -1, 1}}] Integrate[(y - 1/2) - (x + t), Element[{x, t, y}, region]] (* 5/128 *) Check: Integrate[1, Element[{x, t, y}, region]] (* 11/48 *) ...


1

NMaximize[ Abs[a*c + a*d + b*c - b*d], {a, b, c, d} \[Element] Cuboid[{0, 0, 0, 0}]] (* {2., {a -> 1., b -> 1., c -> 1., d -> 1.}} *)



Top 50 recent answers are included