Re: Geometry- transformations
- To: mathgroup at smc.vnet.net
- Subject: [mg34375] Re: Geometry- transformations
- From: GoranG <icmc2MAKNUTIOVO at pop.tel.hr>
- Date: Fri, 17 May 2002 06:31:01 -0400 (EDT)
- References: <abvubg$m53$1@smc.vnet.net>
- Reply-to: icmc2MAKNUTIOVO at pop.tel.hr
- Sender: owner-wri-mathgroup at wolfram.com
On Thu, 16 May 2002 09:32:32 +0000 (UTC), "Hrvoje Posilovic" <hposilovic at inet.hr> wrote: >Dear Mathematica experts, > >I am very new Mathematica user and have one problem >which is for me impossible to solve. >I must define geometric shape by set of points in XY plane and than rotate >that shape (points) in steps of 1 deg around Z axis for 3 or 4 revolutions, >at the same time that >shape must be resized (magnified) by sale fator R for 1 deg reolution >step, and translated downward Z axis by translation factor T for 1 deg >revolution step. There are actually many ways to do this in Mathematica. IMO using Shapes package seems most elegant. Here's an example... use \[Alpha]/° to get 1 deg step. << Graphics`Shapes` \!\(myTransform[g_, \ \[Alpha]_, \ k_, \ z_, steps_] := \[IndentingNewLine]Table[\[IndentingNewLine]RotateShape[\ \[IndentingNewLine]TranslateShape[\[IndentingNewLine]AffineShape[\ \[IndentingNewLine]g, {1 + i \((k - 1)\), 1 + i \((k - 1)\), 1}\[IndentingNewLine]], {0, 0, z\ i}\[IndentingNewLine]], \[Alpha]\ i, 0, 0\[IndentingNewLine]], {i, 0. , \ 1. , \ 1. \/steps}]\) g = Polygon[{{1., 0., 0.}, {0., 1., 0.}, {1., 1., 0.}}]; Show[Graphics3D[myTransform[g, 8.\[Pi], 7, -7., 55.]]] g = Point[{1., 1., 0}]; myTransform[g, 8.\[Pi], 7, -7., 55.] Show[Graphics3D[%]] If you really need only points here's the syntax for stripping procedure... Level[myTransform[g, 2\[Pi], 1., -1., 2\[Pi]/ °], {2}] // TableForm