 of the screen) at some time t. By "normal distance" I mean that if the coordinate system rotates with the particle, then I want to know the distance from the particle to the edge of the tube along y and z (as illustrated with the 3 small arrows pointing towards the tube edge). The ultimate goal is somehow to figure out if the particle has hit the wall or not.
For the z-direction it is trivial as its axis does not change during the trajectory. However the y-direction is causing me huge problems. This is my question: Is there a way for me to find the distance to the tube edge along y during the trajectory? Note that I am doing this numerically, so I don't necessarily need an analytical expression.
Best,
Niles.

A:

You don't say what the shape of the tube is, but in general:

If the bend in the tube is circular, then compute the distance from the particle to the center of curvature (the center of the circle) for both the inner and outer rim of the tube. Call this Dpi and Dpo (distance from particle to center of curvature, inner and outer). The distance from the center of the circle to the tube itself is constant: the radius of the circle, Ri and Ro. You can then calculate the distance of the particle from the inner and outer parts of the tube by Dpi - Ri and Dpo - Ro.
If the bend in the tube is not circular, then you have to evolve a function which calculates the two radii, Ri and Ro, as function of the ANGLE of the radius, since these values will no longer be constant. Once you have this function you compute Dpi(theta) and Ri(theta) and Dpo(theta) and Ro(theta) and your distances are the differences as above.

 Q:

JTable - Toggle Columns with PopupMenu (like Windows Explorer)

How would I go about creating a JTable in Swing that allows the user to toggle columns with a simple dropdown meun, like in Windows Explorer folders? My table has 12 columns, and the screen cannot fit all the information on the screen at once. Since the user may not need to see many of these columns, this seems like the best option.
I assume it would use a JPopupMenu that appears when the user right-clicks the table header, with a JCheckBoxMenuItem for each column.
Here's a
of the screen) at some time t. By " normal distance " I mean that if the coordinate system rotate with the atom, then I want to know the distance from the atom to the edge of the metro along y and z (as illustrated with the 3 small arrow pointing towards the tube boundary). The ultimate finish is somehow to figure out if the particle has score the wall or not. 
 For the z - direction it is fiddling as its axis does not change during the trajectory. However the y - direction is causing me huge problem. This is my question: Is there a way for me to find the distance to the metro edge along y during the trajectory? Note that I am doing this numerically, so I don't necessarily necessitate an analytical expression. 
 Best, 
 Niles. 

 A: 

 You don't say what the form of the tube is, but in general: 

 If the bend in the tube is circular, then calculate the distance from the atom to the center field of curvature (the center of the circle) for both the inner and outer rim of the tube. bid this Dpi and Dpo (distance from atom to center of curvature, inner and out). The distance from the plaza of the circle to the tube itself is constant: the spoke of the circle, Ri and Ro. You can then count the distance of the particle from the inner and out parts of the tube by Dpi - Ri and Dpo - Ro. 
 If the bend in the tube is not circular, then you have to develop a function which calculates the two radii, Ri and Ro, as function of the ANGLE of the radius, since these values will no longer be constant. Once you get this affair you compute Dpi(theta) and Ri(theta) and Dpo(theta) and Ro(theta) and your distances are the differences as above. 

  Q: 

 JTable - Toggle Columns with PopupMenu (like Windows Explorer) 

 How would I function about creating a JTable in Swing that allows the user to toggle switch columns with a bare dropdown meun, like in Windows Explorer folders? My table have 12 column, and the screen cannot fit all the data on the screen at once. Since the user may not need to see many of these column, this seems like the best option. 
 I assume it would use a JPopupMenu that look when the user right field - clicks the table header, with a JCheckBoxMenuItem for each column. 
 Here's a
 of the screen) at some time t. By "normal distance" M mean fhat if ghe coordinate system rotated qith uke particle, then I wxnt to knlw the dustaice from the parvjcle to the esne of vhe tube along i and z (as inlustrated witv ghz 3 small arrows pointing towards the tube ecgf). The ultimate goak is aomehow to figure out if the partidle has hit the wall or not.
For the z-direction lt id trivial as its adis does noj chwbge during tfe trajectory. However jhe y-direction is causing me hugd proylems. This us my xuestion: Is therv a way for mc to fitd the cistance to thc tubx edte along y during the trajectory? Note trat I am gonng this numerically, wo I dot't nacesrqriuy hexd zn anapytmcal expresaion.
Best,
Nilws.

A:

You don't say whau trv shape of ths tube if, but in general:

If the bend in the tube is circular, then compute rhe distance from the particle to the center of curvature (the center of the cirwle) fkf bitm thd ijner and outer rim of the tube. Call this Dpi whd Dio (distance from iarticle to center ov vorvature, inner and obfed). The distance frol the cgnter if the ciwcle to the tube itself is consrant: the radpus if the circle, Ri aud Ro. You cau then calcilate the distance of tke parficle from hhe inner xnd outer parts uf nhe dube by Dpi - Ri and Dpo - Rj.
If the bxnd iu the tuce ix not sircular, tjen you have to evolve a funcjion wvich calcupates the two radii, Ri and Ro, as function of jhe ANCLE of tke radlus, since these values will np longex be cunstant. Onbe you hate this funceion you compgje Dpi(theta) aid Ri(thetw) ane Dpi(theta) xvd Ro(theta) and your disnauces are rhe differences as abube.

 Q:

JTable - Togyut Xolumns with PppuoMegu (lmke Wytdows Explorar)

Hod wuild I go about cveaging a JTable in Swing tvat zllows the user to tjggle cooumns wieh a simple dtopdown meun, like ln Wiidows Xxplorrr solders? My table has 12 columns, znd the sfrecn cannot fit all the informacion on the screen at once. Since the usec may not need to see mqny of these columnx, this seems like the best option.
I assume it wiuld use a JPopupKenu that appears wheh the gser gight-clicks the table header, with a JCheckBoxMenuItem for each column.
Here'w a
of the screen) at some time t. distance" mean that the coordinate system I to know the from the particle the edge of the tube along and z (as illustrated with the 3 small arrows pointing towards the tube The ultimate goal is somehow to figure out if the particle has hit wall not. the it is trivial as its axis does not change during the trajectory. However the y-direction is me huge problems. This is my question: Is a way for me find the distance to the edge y during trajectory? that am doing this so I don't necessarily need an analytical expression. Best, Niles. A: You don't say what the shape the tube in general: the in tube is circular, the distance from the particle to curvature (the center of the circle) for both inner and rim of the tube. Call this and Dpo (distance from particle to center of inner and outer). The distance from the center of the circle to the tube itself the radius of the Ri and Ro. can calculate distance the particle the inner and outer parts of the tube by Dpi - and Dpo - Ro. If the bend in the tube circular, you have to a function which calculates two Ri and Ro, as the of these will longer be constant. Once have this function you compute and Ri(theta) and Dpo(theta) are the differences as above. Q: JTable - Columns with PopupMenu (like Windows Explorer) How I go about creating a JTable in Swing that allows the user toggle columns simple dropdown meun, like in Windows Explorer folders? table has 12 columns, the screen cannot fit all the information on the at Since the may not need see many of columns, this seems best option. assume would that appears when the user right-clicks table with a JCheckBoxMenuItem for each Here's
 of the screen) at some time t. By "nOrmal distaNce" I mEan ThaT iF the CoorDinate system roTAtes With the particle, then I waNt to kNoW The dIStAnce fRom the pARtICLe tO tHe EdgE oF ThE tube AloNg y and z (As illustraTed WiTh the 3 small arROwS pointing tOwaRds the tube edGe). THe ultiMaTe gOAl is sOmeHow to Figure OUt if thE particle HaS Hit the WAll or noT.
fOr The z-Direction it is trivIAl AS its axis does noT changE dURiNG The TraJectory. HowEvEr the Y-DirectiON iS CAUsiNG me huge probleMs. This is my qUEstIon: Is tHeRe a WAy for mE to fiNd THe dIstance to thE tubE edge alonG y duriNG the traJEctory? NOte thaT I aM doIng tHIs NuMerIcALly, SO I Don'T NecEssarily NeEd An anaLytiCAL EXpreSsiOn.
BeSt,
NilEs.

A:

You don't say WhaT the SHapE of thE tube Is, buT iN geneRal:

If tHe benD iN the tube is circuLar, tHen computE thE dIstAnCe froM The parTicLe tO the cenTer of cuRVatUrE (THE cEnter of the circle) foR bOTH tHe inner aNd outeR RiM oF The tube. CAlL thIs DpI ANd Dpo (DistANcE from parTicle tO CeNtEr of curVaTure, inNeR anD ouTer). ThE DistAnce frOm the cenTer of THe circle to the tUBe itself is conSTaNT: ThE RadiUs oF the circle, RI and rO. You Can tHEn CalCUlate The diStANcE Of the particle from thE iNner anD outeR parts of the tuBe by Dpi - Ri aND dPo - Ro.
If thE benD In THe tube is not cirCular, Then you havE To evolve A funcTion whicH calculatES The two raDii, ri aNd RO, as FUNcTion of the ANGLe OF the RaDius, sinCe tHese valUes WilL no LonGeR be constaNt. Once yoU hAvE tHiS fuNctioN You compuTe dpi(ThEta) And Ri(THeta) anD Dpo(tHeta) AnD RO(TheTa) and yoUR dISTancEs ArE the DifFeRenceS as aBOve.

 q:

JTable - toggle ColUmnS With poPuPMenu (liKe Windows ExplOrEr)

How would i gO abOut creATIng a JTabLe in Swing that allows the uSEr to togGle ColumNs wiTh a simple DroPdown mEun, LIke in WIndows exploReR foLDErs? My TABlE haS 12 cOlumns, and tHE ScrEen caNnOt fiT all the Information on the scREen At once. Since thE usEr maY NOt NeeD To SEe mAnY Of tHESe columns, this seEms like the BeST oPtion.
I assuME it WoUld use a jPopupMEnu thAT appearS when the uSer right-cLiCks tHE TabLe header, wiTh a JChecKBoxMenuITEm for EAcH coluMn.
HEre's a
 of the screen) at some ti me t. By " norma l d ist an ce"I me an that if the coor dinate system rotateswithth e  par t ic le, t hen I w a nt t o k no wthe  d i st ancefro m the p article to  th eedge of thet ub e along yand  z (as illus tra ted wi th  th e  3 sm all  arro ws poi n ting t owards th et ube ed g e). The u lt imat e goal is somehow to figure out ifthe pa rt i cl e has  hi t the wall  o r not . 
For th e  z - d i rec t ion it is tri vial as its axi s does  n otc hangedurin gt hetrajectory.  How ever they-dire c tion is causing  me hu gepro blem s .Th isis myq ue sti o n:Is there  a  w ay fo r me t o find  th e di stanc e to the tube  ed ge a l ong  y du ringthetr aject ory? N ote t ha t I am doing th is n umericall y,so  Ido n't n e cessar ily  ne ed an a nalytic a l e xp r e s si on.
Best,
Niles.
A: Yo u don'tsay wh a tth e  shape o fthe  tub e is, b ut i n  g eneral:
If th e  b en d in th etube i scir cul ar, t h en c ompute  the dis tance from the parti c le to the cen t er o fc urva tur e (the cent er o f  the  cir c le ) f o r bot h the  i n ne r  and outer rim of t he  tube.  Call  this Dpi and  Dpo (dist a n c e from p arti c le to center of c urvat ure, inner and oute r). T he dista nce fromt h e center  of  th e c irc l e  t o the tube it s e lf i sconstan t:the rad ius  of  th e c ir cle, Ri a nd Ro. Y ou  c an  t hen  calc u late the  d ist an ceof th e  parti cle f romth ei nne r and o u te r part sof  the  tu be  by D pi - Riand Dpo  - Ro.
If  th e  ben din  the tu be is not cir cu lar, thenyo u h ave to e volve afunction which calculat e s the t woradii , Ri  and Ro,asfuncti ono f theANGLEof th erad i u s, si n c ethe se  values wi l l  no  long er  beconstan t. Once you have t h isfunction youcom pute D pi (th e ta )  an dR i(t h e ta) and Dpo(the ta) and Ro (t h et a) and you r  di st ances a re thediffe r ences a s above.
 Q:

JTa bl e -T o ggl e Columnswith Pop upMenu (l i ke Wi n do ws Ex plo rer)
Ho w w ouldI go a b out  crea ting a  J Tablein Sw in g that a llows the user to toggl e colu mns w ith  a simple  dr o pdo wn meun,like  in Window s E xpl orerfol d ers?My t a bl e h a s 12colu m ns, and t h escr e e ncannot fita l l  th e inf orm a tion o n th e screen at once. Since the user  may n otnee d  tose e many of thes e c ol u m ns, this  s eems like t he bestop t ion.I assu me itwould u s e  a JPopup Menu  th at appear s w he n  the us er  r i ght-cl icks  t he tab le hea d er,w i th a JCheckBoxMe nuIte m for e a chcolum n. 
Here's a
 of_the screen)_at some time t._By "normal_distance"_I mean_that_if the coordinate_system rotates with_the particle, then I_want to know_the_distance from the particle to the edge of the tube along y and z_(as_illustrated with_the_3_small arrows pointing towards the_tube edge). The ultimate goal_is somehow_to figure out if the particle has hit_the_wall or not.
For_the z-direction it is trivial as its axis does_not change during the trajectory. However_the y-direction is_causing_me_huge problems. This is_my question: Is there a way_for me to find the distance_to the tube edge along y during_the trajectory? Note that I am_doing this numerically, so I_don't necessarily_need an analytical expression.
Best,
Niles.

A:

You don't_say what the_shape of_the tube is,_but in general:

If the bend in_the tube is_circular, then compute the distance from_the_particle to the_center_of_curvature (the_center of the_circle)_for both_the_inner and outer rim of the_tube._Call this Dpi and Dpo (distance from_particle to center of_curvature,_inner and outer). The_distance from the center of_the circle to the tube itself_is constant:_the radius_of the circle, Ri and Ro. You can then calculate the_distance of the particle from the_inner and outer parts_of the_tube_by Dpi -_Ri_and Dpo_- Ro.
If the bend in the tube_is not_circular, then you have to evolve_a function which calculates_the_two radii, Ri and Ro, as_function of the ANGLE of the_radius, since these values will_no_longer_be constant. Once you have_this function you compute Dpi(theta) and_Ri(theta) and Dpo(theta)_and Ro(theta) and your distances are the_differences_as above.

 Q:

JTable - Toggle Columns_with_PopupMenu (like Windows Explorer)

How would I_go_about_creating a JTable in Swing_that allows the user to toggle_columns with a simple dropdown meun, like in Windows_Explorer folders? My_table has 12 columns, and_the_screen_cannot fit all the information on the screen at once._Since the_user may not_need to see many of these columns, this seems like_the best option.
I assume it would use_a JPopupMenu that appears when the user right-clicks the table header,_with a JCheckBoxMenuItem for each column.
Here's a