MathGroup Archive 2007

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

Search the Archive

Re: Picking out pieces of a list


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