Tag Info

Hot answers tagged

11

Using Composition I can apply RotationTransform, TranslationTransform , ShearingTransform one after the other. Graphics3D[{ Opacity[1] , Red , Arrow[{{0, 0, 0}, {1, 0, 0}}] , Green , Arrow[{{0, 0, 0}, {0, 1, 0}}] , Blue , Arrow[{{0, 0, 0}, {0, 0, 1}}] , Opacity[0.2] , GeometricTransformation[Cuboid[-{1, 1, 1}/4, {1, 1, 1}/4], ...


9

Rotation about the origin MapIndexed[N@Nest[r, #1, First[#2-1]] &, points] {{0., 0., 0.}, {0.984808, 0.173648, 0.}, {1.87939, 0.68404, 0.}, {2.59808, 1.5, 0.}, {3.06418, 2.57115, 0.}, {3.21394, 3.83022, 0.}} ListPlot[%[[All, {1, 2}]]] the norm of the vectors is conserved. Rotation about the last point Ok, with the new request, rotating ...


6

The easiest way to think about it is to iteratively bend the "line" of points as the program "moves" down the list. "Moves" is accomplished with Rest. The result regrettably has extra data that needs to be discarded, which is done with the ...[[All, 1]] bit of code. rot = N@NestList[ Rest@RotationTransform[10 Degree, {0, 0, 1}, #1[[1]]][#1] &, ...


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

if you want to maintain the original distances between points I would also suggest the following: points1 = points = Most /@ {{0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0}, {4, 0, 0}, {5, 0, 0}}; l = Length[points]; n = 1; While[n++; n <= l , points[[n ;;]] = RotationTransform[10 Degree, points[[n - 1]]][#] & /@ points[[n ;;]]]; ...


1

Here is another approach (to simplify i give a 2D solution - your problem is in 2D - but it can be easily extended in 3D) : (* the coordinates of the first point *) ori = {0, 0}; (* the initial angles between the succesive points *) angles = {0, 0, 0, 0} (* the function to build the coordinates from the angles *) mkpts[ang_] := FoldList[(#1 + {Cos@#2, ...



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