MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Picking out pieces of a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76076] Re: Picking out pieces of a list
  • From: Hatto von Aquitanien <abbot at AugiaDives.hre>
  • Date: Wed, 16 May 2007 05:19:09 -0400 (EDT)
  • References: <f26nc2$42l$1@smc.vnet.net> <f29c20$po4$1@smc.vnet.net>

CKWong wrote:

> I don't know if this qualifies as "tighter", but it doesn't require
> the function m.
> 
> Table[ Flatten[{lst[[i]], Reverse[lst[[Mod[i + 1, Length@lst, 1]]]]},
> 1], {i, Length@lst}] //TableForm

Well, I left my question intentionally somewhat vague in order to see how
other people might approach the general problem.  So I can't complain that
your reply didn't provide the answer I was looking for.

I consolidated my code along the lines you suggested and got this:
Join[lst[[#]], Reverse@lst[[Mod[# + 1, Length@lst, 1]]]] & /@ 
  Range@Length@lst // MatrixForm

There is nothing wrong with that approach.  What I was fishing for is a way
to grab all four points for each Polygon in one pts[[(*what goes here?*)]].

Here's the drawing code using the modifications based on your suggestions.

R3[\[Theta]_, r_: 1.0, p_: {0, 0, 0}] := 
 r {0, Cos@\[Theta], Sin@\[Theta]} + p

r1 = 1.0;
r2 = 0.8;
\[CapitalDelta]x = 0.5;

p1 = {\[CapitalDelta]x, 0, 0};
p2 = {0, 0, 0};

pts = {R3[#, r1, p1], R3[#, r2, p2]} & /@ 
   Range[-\[Pi], \[Pi], \[Pi]/20];

Graphics3D[{Opacity[.3]
  , EdgeForm[]
  , {Line[#], Polygon[#]} &@pts[[All, 1]]
  , Polygon[#] &@pts[[All, 2]]
  , Polygon@
     Join[pts[[#]], Reverse@pts[[Mod[# + 1, Length@pts, 1]]]] & /@ 
   Range@Length@pts}]
-- 
http://www.dailymotion.com/video/x1ek5w_wtc7-the-smoking-gun-of-911-updated
http://911research.wtc7.net
http://vehme.blogspot.com
Virtus Tutissima Cassis


  • Prev by Date: Re: weird behavior when plotting multiple functions in 6.0
  • Next by Date: Re: v6 time series package
  • Previous by thread: Re: Re: Picking out pieces of a list
  • Next by thread: Deleting duplicates from a list