Tag Info

New answers tagged

1

DensityPlot[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, -15, 15}, {y, -4, 4}, AspectRatio -> Automatic] NIntegrate[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, -15, 15}, {y, -4, 4}]/(30 8) (* 14.8171 *) {a, b, c, d, e} = {{0, 0, 12}, {-15, -4, 0}, {-15, 4, 0}, {15, 4, 0}, {15, -4, 0}}; coords = {{b, c, d, e}, {a, b, c}, {a, c, d}, ...


4

dist = UniformDistribution[{{-15, 15}, {-4, 4}}]; avgdist = NExpectation[Norm[{x, y, 12}], {x, y} \[Distributed] dist] (* or NExpectation[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, y} \[Distributed] dist] *) (* 14.8171 *) Update: You can also obtain the average distance symbolically using Integrate[Sqrt[c^2 + x^2 + y^2] Boole[-a < x < a ...


3

To use RotationTransform, as far as I know, you need to have either a vector (or parametric function) or a graphic primitives. I'm still trying to figure out how to transform regions defined by ImplicitRegion For vector We define the ellipsoid parametrically by paramE = {a + a Cos[u] Sin[v], b Sin[u] Sin[v], c Cos[v]} and the rotation function rf = ...


6

This appears to be equivalent to your previous question. ybeltukov's beautiful answer can be adapted. His answer provides volume above x-y plane. volume[p_, abc_] := π Times @@ abc (2/3 + # - #^3/3) & @@ Normalize[abc p] an[a_] := {Cos[Pi/2 - a], Sin[Pi/2 - a], 0} vol[a_, abc_] := 4 Pi Times @@ abc/3 - volume[an[a], abc] a in the above is the angle ...


4

@BobHanlon answer is an amazing replication. I post this to illustrate customizability: trn[a_, s_] := Module[{tr = AASTriangle[Pi/2, a, s], sd, s1, s2, s3, txt, ang, dis}, sd = {s1, s2, s3} = SortBy[Subsets[tr[[1]], {2}], N[EuclideanDistance @@ #] &]; ang = First@Cases[tr[[1]], {_?(#1 != 0 &), 0}]; dis = 0.2 {#, #} ...


1

My output looks a little bit different sphere = {Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}; MeanCurvature[f_] := With[{du = D[f, u], dv = D[f, v]}, Simplify[(Det[{D[du, u], du, dv}] * dv.dv - 2 Det[{D[f, u, v], du, dv}] * du.dv + Det[{D[dv, v], du, dv}] * du.du) / (2 Simplify[(du.du * dv.dv - (du.dv)^2)]^(3/2))]]; mean = ...


8

For simple graphics just build them step-by-step from graphics primitives. Graphics[{ (* triangle *) Line[{{0, 0}, {0, 1}, {1, 0}, {0, 0}}], (* right angle symbol *) Line[{{0, 0.1}, {0.1, 0.1}, {0.1, 0}}], (* angle symbol *) Circle[{1, 0}, 0.2, {127.5 Degree, 187.5 Degree}], (* labels *) Rotate[ Text[Style["opposite side (= y)", 20], ...


4

Just use MeshFunction. Manipulate[ParametricPlot3D[{Sin[\[Theta]] Cos[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Theta]]}, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotStyle -> Opacity[0.5], Mesh -> {{0.}}, MeshStyle -> {Red, Thick}, MeshFunctions -> {Sin[a] Cos[b] #1 + Sin[a] Sin[b] #2 + Cos[a] #3 &}], {a, 0, \[Pi]}, {b, 0, 2 \[Pi]}] ...


2

In this I have made $(x_2,y_2)$ the origin: f[a_, t_] := a Exp[t] Manipulate[ Column[{ ParametricPlot[{s f[a, t] Cos[t], s f[a, t] Sin[t]}, {t, angle, 0}, {s, 0, 1}, PlotRange -> {{-1, 2}, {-1, 0.1}}, ImageSize -> 400, BoundaryStyle -> {Red, Thick}], Row[{"Area: ", Integrate[0.5 f[a, u]^2, {u, angle, 0}]}] }, Alignment -> ...


2

I don't really understand what is known and what is not, but assuming that you know x1, y1, x2, y2 and a you can do (with v8, I assume v10 makes it much easier): {x1, y1} = {0, 0}; {x2, y2} = {2, 3}; angle[v1_, v2_] := N@ArcCos[(First@v1*First@v2 + Last@v1*Last@v2)/(Norm@v1*Norm@v2)] eqn[k_, l_, a_, x_, α_] := k + l*a*Exp[x*α] kk[l_, a_] := k /. ...


4

Visualization of the @ybeltukov's answer This is not an answer, just visualization of ybeltukov's answer. Step 1 direction3D for direction handling. opt1 = Sequence[Orange, Thick, Arrowheads[.15]]; opt2 = Sequence[PlotRange -> 1, Ticks -> None, Boxed -> False, ViewPoint -> {1, 1, 4}, ViewVertical -> {0, 1, 0}, PlotRegion -> {{-.2, ...


7

Let you have a vector ${\bf p}$, which is perpendicular to the plane and an ellipsoid with axes $(a,b,c)$. The illustration (2D for simplicity): Mathematica can calculate the numeric value of the clipped volume easily Nvolume[p_, abc_] := Volume[RegionIntersection[ ImplicitRegion[{x, y, z}.N[p] > 0, {x, y, z}], Ellipsoid[N[abc] {1, 0, 0}, ...


5

Functions for generating ellipsoid $x^2/a^2+y^2/b^2+z^2/c^2=1$ and plane through point $\vec{p}$ with normal $\vec{n}$, i.e $\vec{n}\cdot(\vec{r}-\vec{p})=0$ el[a_, b_, c_, x_, y_, z_] := x^2/a^2 + y^2/b^2 + z^2/c^2 pl[n_, p_, x_, y_, z_] := z /. First@Solve[n.({x, y, z} - p) == 0, z] Using as an example: a=1, b=2,c=3 and normal {1,0,par}: Manipulate[ ...


1

This function can be used to generate the contour points in the clockwise order. The starting point is fixed as the left point having the same y as the centroid of the contour. ContourBasedFeature[silhouette_] := Module[{centroid, startpoint, positions, contourPoints, order, clockwiseorder}, ( centroid = ComponentMeasurements[silhouette, ...


1

Here's a way: Let's use a GeoDisk[] centered around the great city of Houston, TX: houmap = GeoGraphics@ GeoDisk[CityData[{"Houston", "Texas", "UnitedStates"}, "Position"], Quantity[50, "Miles"]] Now we can extract all the drawn polygons in the image: Cases[houmap, Polygon[__], Infinity] // Length 3 To verify which one we want: Graphics/@ ...


0

Through 5 points we can pass a conic, an ellipse, hyperbola etc. After Algohi's solution coefficients are obtained we can determine choice of conic by sign of the second evaluated invariant $ (b^2 - 4 a c) $ along with standard calculated expression for values of rotation/translation of central conic.A sign change test for a test point chosen inside or ...


7

You can use the built-in functionality PolyhedronData["Icosahedron", "VertexCoordinates"] {{0, 0, -(5/Sqrt[50 - 10 Sqrt[5]])}, ... } or this short generator {0,##2}~RotateLeft~#&@@@Tuples@{{1,2,3},s={-1,1},s(1+√5)/2} ConvexHullMesh[%]


4

You can try this: V = Table[RotateRight[{0, (-1)^j, (-1)^Floor[j/2] GoldenRatio}, Floor[(j - 1)/4]], {j, 12}]; You can plot it using ConvexHullMesh: ConvexHullMesh[V]


3

You can use option Epilog $PointStyle = Directive@{PointSize[Large], Red}; distanceX = Sqrt[(x - 8000)^2 + y^2]; distanceY = Sqrt[x^2 + y^2]; rate1 = 45; rate2 = 60; point["camp location"] = Point[{8000, 0}]; curve["Circle of Apollonius"] = ImplicitRegion[distanceX/distanceY == rate1/rate2, {x, y}]; RegionPlot[{curve["Circle of Apollonius"]}, Method ...


3

One way to do this is to separate the RegionPlot from the point you are trying to plot, and instead render it separately: distanceX = Sqrt[(x - 8000)^2 + y^2]; distanceY = Sqrt[x^2 + y^2]; rate1 = 45; rate2 = 60; point["camp location"] = Point[{8000, 0}]; curve["Circle of Apollonius"] = ImplicitRegion[distanceX/distanceY == rate1/rate2, {x, y}]; ...


1

I'm not entirely sure what you're trying to do or what your plot is supposed to look like, but one way to do this is to make the Show[...] object a function of two string inputs, like so: Show[RegionPlot[curve[#1], Method -> {"DiscretizationMethod" -> "Symbolic"}], Graphics[{point[#2], Text[#2, point[#2] + {0, 1}]}]] &["path ...



Top 50 recent answers are included