New answers tagged

2

A simpler and minimal version Manipulate[ Graphics[{Red, Circle[{0, 0}, Cos[Pi/n]], Blue, Circle[{0, 0}, 1], Green, Line[{Cos[2 Pi #/n], Sin[2 Pi #/n]} & /@ Range[0, n]]}], {n, 3, 30, 1}] Inner circle will adjust itself according to the polygon.


6

There are numerous ways to do this in Mathematica, and it's hard to say which would be most useful for learning. Here's one; a unit circle is drawn, then a polygon with no filling and black edge on basis of CirclePoints which generates points of a regular polygon lying on the unit circle. Finally, mean of two first points is taken, and distance to the origin ...


0

The general method that generating a cylindrical surface is using NURBS theory. See here or here. However, the critical step is solving the contorl-point of the extruded section. Here, I think the tangent-point $A,B,C,D$ should be calculated firstly, and then sampling many midpoints between tangent-point $A, B$ and $C, D$, respectively. Lastly, the ...


6

Today, I discovered an example from Wolfram Documentation Center about plotting a parametric region: ParametricPlot[ r^2 { Sqrt[t] Cos[t], Sin[t]}, {t, 0, 3 Pi/2}, {r, 1, 2}] Namely, ParametricPlot[] could generate the region of family: $f(\theta,t)$ For my question, it is a family of ellipses with respect to time variable $t$. {δxp, δyp, δzp} = ...


3

Here is an approach came from this answer and bbgodfrey's answer. In addition, it is very fast. s = DiscretizeGraphics@ Graphics[Polygon /@ Table[Table[{a + 5 Cos[theta], b + 6 Sin[theta]}, {theta, 0, 2 Pi, 0.02 Pi}], {a, -2.5, 2.5, 1}, {b, -2.5, 2.5, 1}]] t = TransformedRegion[s, TranslationTransform[{2.5, 3}]]; RegionBoundary@ ...


0

Example: Arbitrary data p1 = {0, 0, 0} (* This defines point no. 1*) p2 = {0, 0, 10} (* This defines point no. 2*) Process Graphics3D[Line[{p1, p2}]] Reference: Graphics3D Line


2

This is a bit late, but I only recently learned of the "AdjacentFaceIndices" property in PolyhedronData[], and this is what led me to figure out how to cleanly deal with generating the required triangles. First, generate the extra pentagram points from the original dodecahedron's vertices: np = First @ Normal[PolyhedronData["Dodecahedron", "Faces"]] /. ...


3

As noted by Rahul, one can always fall back on using the Rodrigues rotation formula if need be: rodrigues[th_, axis_?VectorQ] := With[{om = -LeviCivitaTensor[3].Normalize[axis]}, IdentityMatrix[3] + om Sin[th] + 2 MatrixPower[om, 2] Sin[th/2]^2]



Top 50 recent answers are included