Tag Info

New answers tagged

2

You can use all of Three‐Dimensional Graphics Primitives like so; a = {1, 1, 1}; b = {1, -1, 2}; Graphics3D[{Red, Arrow[{a, b}]}, Axes -> True, Boxed -> True, AxesLabel -> {x, y, z}] If useful, WA also can process this information, check the parametric info; And there is a verry nice Reference on this Site: Plot points, line and plane in ...


2

To expand on Nikie's comment... Graphics3D[Arrow[{{1, 1, 1}, {1, -1, 2}}], Axes -> True, AxesLabel -> {"X", "Y", "Z"}, ImageSize -> Large] Arrow is a symbolic graphics primitive. Graphics3D is a function to draw graphics primitives.


3

ImplicitRegion seems to work fine: ir = With[{b = 2, h = 2}, ImplicitRegion[{(x)^2 + (y - b)^2 > h^2 + b^2 && (x)^2 + (y - b - h)^2 > h^2 + b^2 && (x - h)^2 + (y - 2 b - h)^2 > h^2 + b^2 && (x - h - b)^2 + (y - 2 b - h)^2 > h^2 + b^2 && (x - 2 h - b)^2 + (y - b - h)^2 > h^2 + b^2 ...


5

Since "Visualizing the resulting triangle is left as an exercise for the interested reader" and I am interested here is a visualization of J.M.'s numeric solution. DynamicModule[{corners, perimeter, sol, u, v, pts}, Manipulate[ corners = {{-c, 0}, b {(1 - u^2)/(1 + u^2), 2 u/(1 + u^2)}, a {(1 - v^2)/(1 + v^2), 2 v/(1 + v^2)}}; perimeter[u_, v_] = ...


6

Update Based on Guesswhoitis. answer I have improved my ugly code and use his approach. Otherwise the format is as outlined in original answer. Manipulate[p = {-a, 0}; q = {0, b}; r = {c, 0}; s = mp[a, b, c]; nfb = RegionNearest[Circle[{0, 0}, b]]; nfc = RegionNearest[Circle[{0, 0}, c]]; res = VectorAngle @@@ Partition[Join[{{-a, 0}}, sc[#] & /@ ...


21

I've decided to expand on my comment. Before I delve into the solution, let's all pause for a moment and marvel at the stereographic parametrization of a unit circle: $$\begin{pmatrix}\frac{1-t^2}{1+t^2}\\\frac{2t}{1+t^2}\end{pmatrix}$$ Sometimes also referred to as the Weierstrass substitution, it has often been used as a tool in the solution of algebraic ...


3

g = Graphics[{PointSize[.02], Point[{9, 5}], Point[{2, -5}], Point[{5, 5}], Point[{3, 6}], Point[{1, 1}], Point[{5, -7}], Point[{-7, 4}], Point[{6, -10}], Point[{-6, -2}], Point[{0, 8}], Point[{1, 4}], Line[{{1, 4}, {2, 5}}], Point[{2, 5}]}, AspectRatio -> Automatic]; g /. Point -> (Circle[#, .5] &)


4

The following is (I believe) a better implementation for at least two reasons. First, it doesn't use the old Splines package, but Interpolation[..., Method -> "Spline"] instead. Second, if uses an algorithmic arc length parametrization to get the equispaced points instead of relying on the mesh generated by ParametricPlot which is nice for displaying but ...


2

Your points aren't in order. Change: coord = Cases[Normal@plot, Point[p_] :> p, Infinity] by coord = Sort@Cases[Normal@plot, Point[p_] :> p, Infinity] Then you'll get (Norm /@ Differences@p1)[[1 ;; 5]] (Norm /@ Differences@coord)[[1 ;; 5]] (* {1., 1., 1., 1., 1.} {0.976258, 0.97659, 0.975463, 0.976125, 0.976947} *)


11

It turns out ListSurfacePlot3D does a terribly poor job of approximating the surface in the OP, otherwise one will just apply DiscretizeGraphics to the output obtained from ListSurfacePlot3D and be done with it. But since that's not applicable here, we present an approach that uses alpha shapes to approximate the shape of the given point set by tuning a ...


3

As I noted in this answer, there is a built-in, but undocumented function that can do this: p1 = Partition[{{243.8, 77.}, {467.4, 12.}, {291.8, 130.}, {476., 210.5}, {103.2, 327.}, {245.2, 110.5}, {47.4, 343.}, {87.4, 108.5}, {371., 506.5}, {384.6, 277.}, {264.6, 525.5}, {353.8, 294.5}, {113.2, 484.5}, {296., 304.5}, ...


3

Here's my attempt at an implementation, using ReliefImage[] to give the plots some depth perception: triangleTicks[arg_List: {5, 4}, tl_: 0.01] := Module[{divs, dQ, sides, st}, dQ = VectorQ[#, IntegerQ] && Length[#] == 2 &; sides = Partition[{{0, 0}, {1, 0}, {1, Sqrt[3]}/2}, 2, 1, 1]; divs = If[dQ[arg] || ...


11

Method 1: Construct mesh elements manually We can triangulate a periodic quad-lattice on the surface: n = {180, 20}; (* number of points in each direction *) pts = Table[ g[4. Pi/n[[1]] t, 2. Pi/ n[[2]] θ], {t, n[[1]]}, {θ, n[[2]]}]; idcs = {{{1, 2, 4}, {1, 4, 3}}, {{1, 2, 3}, {2, 4, 3}}}; (* for a diamond pattern *) tri = 1 + Array[Function[quad, ...


5

The problem is that PolyhedronData["DodecahedronIcosahedronCompound"] consists of an intersecting dodecahedron and icosahedron: PolyhedronData["DodecahedronIcosahedronCompound"] /. Polygon[p_] :> {Opacity[0.6], Riffle[{Red, LightBlue}, Polygon /@ SplitBy[p, Length]]} A fix is to cut out the middles of the faces of the dodecahedron and ...


18

Here is a slightly different way to do it. We write a function that converts any PDE (1D/2D/3D) into discretized system matices: Needs["NDSolve`FEM`"] PDEtoMatrix[{pde_, \[CapitalGamma]___}, u_, r__, o : OptionsPattern[NDSolve`ProcessEquations]] := Module[{ndstate, feData, sd, bcData, methodData, pdeData}, {ndstate} = ...


0

You can take your data and feed it into Interpolation to get something that Mathematica views as a continuous function. As an example, let's look at a the metric for a spherically symmetric constant-density star (see Schutz's A First Course in General Relativity, §10.6). This is an unrealistic model, but it has the advantage that there exists an analytic ...


6

There are a few things to be said here. First, it should not crash and a future version will behave better in this scenario. What I am not quite sure abuot is why the call ToElementMesh[DiscretizeRegion[...]] in the first place. Note that both mesh = ToElementMesh[\[CapitalOmega]]; and DiscretizeRegion[\[CapitalOmega]]; work fine. In your example you ...


1

This is in response to Chris's request in comments, but not an answer to his question. I tried running the code you asked: {ev, if, mesh} = helmholzSolve3D[\[CapitalOmega], 4, MaxCellMeasure -> 0.25] with the definition of Omega that you have in the current question, and the definition of helmholzSolve3D from ...


13

This slightly modified function Needs["NDSolve`FEM`"]; helmholzSolve3D[g_, numEigenToCompute_Integer, opts : OptionsPattern[]] := Module[{u, x, y, z, t, pde, dirichletCondition, mesh, boundaryMesh, nr, state, femdata, initBCs, methodData, initCoeffs, vd, sd, discretePDE, discreteBCs, load, stiffness, damping, pos, nDiri, ...


5

For the first usage, with an input list t of angles, I used: anglePath[t_?VectorQ] := With[{a = Accumulate[t]}, Join[{{0., 0.}}, Accumulate[Transpose[{Cos[a], Sin[a]}]]]] For the second usage, with an input matrix of {r,t} pairs, I used: anglePath[t_?MatrixQ] := With[{a = Accumulate[t[[All, 2]]]}, Join[{{0., 0.}}, ...


4

You can make your own satan-worshiping dodecahedron by using texture. The following is more-or-less based on a Neat Example in the Texture documentation. First, download your favourite evil pentagram image: im = Import["http://vignette1.wikia.nocookie.net/sonicfanchara/images/9/9c/\ Goth-pentagram-devil.gif/revision/latest?cb=20131018174814"]; Then ...



Top 50 recent answers are included