17

Here we manual create the normal line of the three differentiable curves. f[x_] := x^x; g[x_] := Log[x]^Log[x] h[x_] := Log[x]^2 eq1 = {x1, f[x1]} + t*Normalize[{-f'[x1], 1}]; eq2 = {x2, g[x2]} + t*Normalize[{-g'[x2], 1}]; eq3 = {x3, h[x3]} - t*Normalize[{-h'[x3], 1}]; sol = NMinimize[{0, (eq1 - eq2)^2 + (eq2 - eq3)^2 + (eq3 - eq1)^2 == 0}, {x1, x2, x3, ...


16

f[x_] := x^x g[x_] := Log[x]^Log[x] h[x_] := Log[x]^2 plot = Plot[{f[x], g[x], h[x]}, {x, 0, E}, PlotRange -> {0, 1}] Extract the three lines from plot and use them to construct three RegionDistance functions: {linef, lineg, lineh} = Cases[plot, _Line, All]; {rdf, rdg, rdh} = RegionDistance /@ {linef, lineg, lineh}; ContourPlot to get the lines where ...


6

There's a long winded way with TimeSeriesThread or interpolation and subtracting the curves to find zero crossings, however there's also a shortcut where you can extract the lines from the plot and immediately get the intersections: tmp = WolframAlpha["EUR vs USD in 2020", {{"Result", 1}, "ComputableData"}]; data = TimeSeries@...


5

Find where the differences between two time series change sign by subtracting the second series from the first. The transitions show the dates where the two series intersect. transitions = Sign[smoothedData[[1]] - smoothedData[[2]]]; DateListPlot[transitions] None of the intersecting values are equal (none of the differences are zero). Position[transitions[&...


4

In the equations of ellipse, replace b by 5/(Pi*a) so just one parametric say a, then it is easy to create a table ell satisfy Pi*a*b=5 Clear["`*"]; Clear[x, y] ellipse = x^2/a^2 + y^2/b^2 == 1 /. b -> 5/(Pi*a); curve = Abs[y] == 5/(2*Pi*Abs[x]); ell = Table[ellipse, {a, 0.5, 2.0, 0.5}]; curvep = ContourPlot[Evaluate[curve], {x, -7, 7}, {y, -7, ...


4

We use the implicit exprssion of plane. The normal of plane is Cross[b-a,c-a] ({x, y, z} - a).Cross[b - a, c - a]==0 And we also use the implicit expression of sphere,here {5,0,0} is the sphere center and 10 is radius. Norm[{x, y, z} - {5, 0, 0}] - 10==0 Norm[{x, y, z} - {5, 0, 0}] - 10 as MeshFunction x = InfiniteLine[{{0, 0, 0}, {1, 0, 0}}]; y = ...


4

One of the regular tasks in statistical arbitrage is to compute correlations between a large universe of stocks, such as the S&P500 index members, for example. Mathematica/WL has some very nice features for obtaining financial data and manipulating time series. And of course it offers all the commonly required statistical functions, including correlation....


4

Use the option Graphics`Mesh`AllPoints -> False Graphics`Mesh`FindIntersections[plot, Graphics`Mesh`AllPoints -> False] {{4.68871, 0.71373}} Where do the extra points come from? Repeated consecutive points count as intersections. There are two such points in lst1: Select[#[[2]] > 1 &]@Tally[lst1] {{{1.61711, 0.838028}, 145}, {{7.2771, -2....


4

domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}]; domain2[R_] := Disk[{0, 0}, R] Table[RegionEqual[RegionIntersection[domain1, domain2[R]], domain2[R]], {R, {1, 2, 3}}] {True, True, False}


4

domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}]; domain2[R_] := Disk[{0, 0}, R] You can use RegionWithin: ClearAll[condition] condition[R_] := Boole @ RegionWithin[domain1, domain2[R]] {condition[1], condition[3]} {1, 0} You can also use a combination of ForAll and Resolve: ClearAll[conditionB] conditionB[R_] := Resolve[ForAll[x, Implies[x ∈ domain2[R], x ∈...


4

Using the two-argument form of DiscretizeRegion we get three points: MeshCoordinates[DiscretizeRegion[ri, CoordinateBounds[ri]]] {{2.95674, 3.87023}, {3.20154, 4.60463}, {3.42285, 5.26855}} FWIW, we can also use MeshPrimitives to get the three Points: MeshPrimitives[DiscretizeRegion@ri, 0] {Point[{2.95674, 3.87023}], Point[{3.20154, 4.60463}], Point[{3....


3

Method 1 Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc]. For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we can set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}} np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))...


3

np = 2; f[pc_] = 1; dmin = 8; dmax = 24; dincr = 4; q[d_, pc_] = (pc/(100*12/25))* Sum[((Pi/4)*(d - (2*n*12/25))^2), {n, 1, np}] // Simplify; p[d_] = Sum[Pi*(d - (2*n - 1)*12/25), {n, 1, np}] // Simplify; g[d_, pc_] := q[d, pc]/p[d]; pt[d_] = {pc, f[pc]} /. Solve[g[d, pc] == f[pc], pc][[1]]; Plotting Plot[{ Evaluate[Table[g[d, pc], {d, dmin,...


3

Here wee use {x, 0.5, r1}, {y, 0.5, r2}, {z, 0.5, r3} to cut the region x*y*z - x - y - z + 2*Cos[45] > 0 and set the PlotRange to some large space PlotRange->{{0, r1 + 1}, {0, r2 + 1}, {0, r3 + 1}} and then we get the second plot intersection. r1 = 3.7; r2 = 1.3; r3 = 3; intersection = RegionPlot3D[ x*y*z - x - y - z + 2*Cos[45] > 0, {x, 0.5, ...


3

We can also use RegionMember and Solve or Reduce to get the points. sol = Solve[RegionMember[ri, {x, y}]] {x, y} /. sol // N {{2.95674, 3.87023}, {3.20154, 4.60463}, {3.42285, 5.26855}}


3

Conversion of @kglr's and @cvgmt's comments into a community wiki answer (edited slightly for clarity): @cvgmt: rectangle = Rectangle[{1, 1}, {2, 2}]; circle = Disk[{0, 0}, 2]; Area[RegionIntersection[rectangle, circle]] @kglr: use Disk instead of Circle if you want the area. Or use ArcLength instead of Area if you want the length of the arc.


3

For general parametric curves, NMinimize sometimes work. Here we give an example. We change the sign of {t1,t2,t3}, for example t1 < 0, t2 < 0, t3 > 0. But there still a result is not correct,that is t1 < 0, t2 < 0, t3 < 0 can not work,in this case, the result should be a large circle which just contain all the three circles.(The minimal ...


3

Here is a slightly more general attempt to solve the problem with NMinimize without "tricks". It is based on the idea used in @cvgmt interesting answer. Because the "sign" of the normal directions isn't known one has to introduce three parameters t1,t2,t3 instead of t, all having the same absolut value: f[x_] := x^x; g[x_] := Log[x]^Log[...


3

line1 = Line[lst1]; line2 = Line[lst2]; RegionIntersection[line1, line2] (* Point[{{4.68871, 0.71373}}]*)


2

For some applications, an alternative to using TimeSeries expressions is using associations which support both a fast KeyIntersection and KeyUnion operation. The example by Jonathan Kinlay from another answer to this question can be rewritten using associations in the following way: First retrieve market data as a list of associations by using the "...


2

Mathematica's region / Boolean CSG stuff is sadly very buggy, even in some simple cases like this where you really wouldn't expect it. I'm hoping it improves in future versions. To work around this I discretize the mesh into polygons and intersect each polygon individually, building up a list of EmptyRegion[3] and lines. The empty regions are discarded. ...


2

Using the Mesh option, as indicated in the link only works fur cuts parallel to a coordinate plane. For arbitray intersections: You can get the cut of your two regions by: "RegionIntersection[plane, sphere]". However, what you get is not a graphical primitive. So, you can not simply use it in Graphics3D. To turn it into something that Graphics3D ...


2

Perhaps ContourPlot helps to find the intersection points! Try e1= -0.0492101+(0.00982664*l3*Sec[147.557*l3]^2*(Tan[147.557*l8]+3.34665*Tan[152.139*l8]))/(Tan[152.139*l3]*Tan[147.557*l8]-Tan[147.557*l3]*Tan[152.139*l8])+(0.00982664*l8*Sec[147.557*l8]^2*(Cot[147.557*l8]*Tan[147.557*l3]+3.34665*Cot[147.557*l8]*Tan[152.139*l3]))/(-Tan[152.139*l3]+Cot[147.557*l8]...


1

For a minimal change in your code, replace the second plot with Plot[mpk[a, kk, xintersectlabor[a, kk, l, c, b, m], c], {kk, 0, 500}, PlotRange -> {5, 125}, AxesLabel -> {"Capital, K", "\!\(\*SubscriptBox[\(MP\), \(K\)]\)"}, PlotLabel -> "Right Diagram", LabelStyle -> Black, ImageSize -> {400, 250}, ...


1

To give context for the reader, You create a circle and a square and by asking the intersection you generate regions, highlighted in red. The question is whether there is a way to extract an angle randomly, that belongs to any of the segments of your experiment. regions = RegionIntersection[ ExperimentLocation[x1, y1 + dy/2, dx, dy, Rdet, experiment], ...


1

The mathematical setup I'll spare you the mathematical proof (unless you want it!), but say: $\cal G$ is the set of atomic labels (like "Passed") We identify the powerset $\cal PG$ as the set of strings formed from them (e.g. $\{$"Boys"$\text{, }$"Passed"$\}$ corresponds to "Boys" ⊓ "Passed". Note the switch ...


1

For plane, we can decreasing the MaxCellMeasure instead of increasing it. reg = ImplicitRegion[ x + y + z <= 3 && x + z <= 1 && 0 <= x <= 3 && 0 <= y <= 3 && 0 <= z <= 2, {x, y, z}]; RegionPlot3D[DiscretizeRegion[reg, MaxCellMeasure -> 1]]


1

Use the "BSPTree" rendering method as this doesn't suffer from z-buffer precision issues and produces crisp edges: theplot = Show[{ParametricPlot3D[{x, y, 0}, {x, -4, 4}, {y, -4, 4}, PlotStyle -> LightGray, Mesh -> None], ParametricPlot3D[{0, 0, t}, {t, -8, 8}, PlotStyle -> Blue], ParametricPlot3D[{x, 0, z}, {x, -3, 3}, {...


Only top voted, non community-wiki answers of a minimum length are eligible