The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

1

Try NMinimize[{x^2 + y^2 + z^2 + u^2 + v^2 +w^2, {x + y + z + u + v + w == 1, x^2 + y^2 + z^2 + u^2 + v^2 == 1}}, {x, y, z, u, v, w}] (*{1., {x -> -0.0316501, y -> -0.253188, z -> 0.544651, u -> 0.796892,v -> -0.0566812, w -> -0.0000230699}}*) and NMaximize[{x^2 + y^2 + z^2 + u^2 + v^2 +w^2, {x + y + z + u + v + w == 1, x^2 + y^2 + z^2 ...


5

RegionPlot[ x^2 + y^2 < 25 \[And] ((x - 5)^2 + (y + 5)^2 > 100 \[Or] (x + 5)^2 + (y - 5)^2 > 100), {x, -5, 5}, {y, -5, 5}] Or... z[w_] := EuclideanDistance[{x, y}, w {5, -5}]; RegionPlot[ z[0] < 5 \[And] (z[1] > 10 \[Or] z[-1] > 10), {x, -5, 5}, {y, -5, 5}] Or... z[w_] := (a = ({x, y} - 5 {w, -w})).a; RegionPlot[ z[0] < 25 \[...


11

f1h = HoldForm[10 - Sqrt[10^2 - x^2]]; f1 = f1h // ReleaseHold; f2h = HoldForm[5 - Sqrt[5^2 - (x - 5)^2]]; f2 = f2h // ReleaseHold; f3h = HoldForm[5 + Sqrt[5^2 - (x - 5)^2]]; f3 = f3h // ReleaseHold; The x values for the curve intersections are {x1, x2} = x /. Solve[f1 == #, x][[1]] & /@ {f2, f3}; The point coordinates for the curve intersections ...


7

One simple way to visualize complicated regions in mathematica disk1 = Region[Disk[{5, 5}, 5]] disk2 = Region[Disk[{0, 10}, 10]] disk3 = Region[Disk[{10, 0}, 10]] result = Region[ RegionUnion[RegionDifference[disk1, disk3], RegionDifference[disk1, disk2]]]


2

As discussed by Chip Hurst, the lower boundary of the region can be obtained by setting a2=-1. Therefore, this boundary is parametrized by a1 only (let it be called $(A,T)$): reg = With[{a2 = -1}, {1 + a1/(-1 + a2), 1 - 2 ArcCsc[2/Sqrt[1 + a1 - a2]]/\[Pi]}] {1 - a1/2, 1 - (2 ArcCsc[2/Sqrt[2 + a1]])/[Pi]} This can be solved to get a1 as a function of A: ...


2

To avoid the artifacts from singularities and jumps, we can take a somewhat manual approach. Notice that the bottom boundary is formed from a2 == -1, the top boundary is a horizontal line formed as a2 -> 1 from the left, and the left boundary is a vertical line formed as a2 sweeps from -1 to 1. So we can get a clean graphic by plotting the bottom ...


1

Try option RegionFunction inside ParametricPlot together with the Option MaxRecursions. The second plot argument 1 - 2 ArcCsc[2/Sqrt[1 + a1 - a2]]/\[Pi] is only defined for 1 + a1 >= a2, that's why I only consider this restriction! ParametricPlot[ {1 + a1/(-1 + a2) ,1 - 2 ArcCsc[2/Sqrt[1 + a1 - a2]]/\[Pi] }, {a1, -2, 2}, {a2, -1, 1},Frame -> True, ...


2

We can split the domain into multiple finite pieces: opts = {Mesh -> None, PlotStyle -> {Opacity[1], Hue[0.6, 0.3, 0.95]}, BoundaryStyle -> None, PlotPoints -> 50}; f[a1_, b1_] := {1 - a1 + ((-1 + a1^2) b1)/(1 + 2 a1 b1 + b1^2), 1 - 2 ArcSin[1/2 Sqrt[((1 + a1) (1 + b1 (a1 + b1)))/(1 + b1 (-1 + a1 + b1))]]/π} Show[ ParametricPlot[f[a1, ...


0

Hope the following clarifies how quarter disks centered at {0,0}, {1,0}, {1,1} and {0,1} can be constructed using a single parameter: Manipulate[Graphics[{EdgeForm[{Opacity[1], Thick, Orange}], Opacity[.3], Orange, Disk[{0, 0}, 1, {0, θ}], EdgeForm[{Opacity[1], Thick, Blue}], Blue, Disk[{1, 1}, 1, {-Pi, -Pi + θ}], EdgeForm[{Opacity[1], Thick, ...


Top 50 recent answers are included