Re: Output display by slide
- To: mathgroup at smc.vnet.net
- Subject: [mg131776] Re: Output display by slide
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Wed, 2 Oct 2013 05:54:56 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
a=3; b=2.5; c=2 ; (* Given triangle vertices are {(0,0),(x1,y1),(x2,y2)} = { (0,0),(a,0),(b,c) } to find CG *) v1=Graphics[Circle[{0,0},{.03,.03}]];v2=Graphics[Circle[{a,0},{.03,.03}]];v3=Graphics[Circle[{b,c},{.03,.03}]]; x1=a;y1=0;x2=b;y2=c; {XF,YF}={x1+x2, y1+y2}/3; CG=Graphics[Disk[{XF,YF},{.05,.05} ]]; Triang=Graphics[Line[{{0,0},{a,0},{b,c},{0,0},{XF,YF},{a,0},{XF,YF},{b,c},{XF,YF},{0,0}}] ] ; bb=Show[{v1,v2,v3,Triang,CG},GridLines->Automatic,Axes-> True ,AspectRatio-> Automatic, PlotLabel-> "Centre of Gravity"] How to vary b value in a SlideView or Manipulate, say between 0 to 4, (along horizontal line y =2) to display Centre of Gravity like it is in GSP or in Java mode ? TIA, Narasimham Hi, Narasimham, Try this for the SlideView: SlideView[ Table[a = 3; c = 2; (*Given triangle vertices are {(0,0),(x1,y1),(x2,y2)}={(0,0),(a, 0),(b,c)} to find CG*) v1 = Graphics[Circle[{0, 0}, {.03, .03}]]; v2 = Graphics[Circle[{a, 0}, {.03, .03}]]; v3 = Graphics[Circle[{b, c}, {.03, .03}]]; x1 = a; y1 = 0; x2 = b; y2 = c; {XF, YF} = {x1 + x2, y1 + y2}/3; CG = Graphics[Disk[{XF, YF}, {.05, .05}]]; Triang = Graphics[ Line[{{0, 0}, {a, 0}, {b, c}, {0, 0}, {XF, YF}, {a, 0}, {XF, YF}, {b, c}, {XF, YF}, {0, 0}}]]; bb = Show[{v1, v2, v3, Triang, CG}, GridLines -> Automatic, Axes -> True, AspectRatio -> Automatic, PlotLabel -> "Centre of Gravity"], {b, 0, 4, 0.5}] ] Or this for Manipulate: Manipulate[a = 3; c = 2; (*Given triangle vertices are \ {(0,0),(x1,y1),(x2,y2)}={(0,0),(a,0),(b,c)} to find CG*) v1 = Graphics[Circle[{0, 0}, {.03, .03}]]; v2 = Graphics[Circle[{a, 0}, {.03, .03}]]; v3 = Graphics[Circle[{b, c}, {.03, .03}]]; x1 = a; y1 = 0; x2 = b; y2 = c; {XF, YF} = {x1 + x2, y1 + y2}/3; CG = Graphics[Disk[{XF, YF}, {.05, .05}]]; Triang = Graphics[Line[{{0, 0}, {a, 0}, {b, c}, {0, 0}, {XF, YF}, {a, 0}, {XF, YF}, {b, c}, {XF, YF}, {0, 0}}]]; bb = Show[{v1, v2, v3, Triang, CG}, GridLines -> Automatic, Axes -> True, AspectRatio -> Automatic, PlotLabel -> "Centre of Gravity"], {b, 0, 4}] Have fun, Alexei Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu