Author Topic: Another Cliper  (Read 13398 times)

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Another Cliper
« on: September 03, 2009, 07:30:55 pm »
The following is a cliper simulation.
You can change the width of the blue object or the diameter of the green object
(click diameter to show the object and measure it's diameter).

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!


You may want to view the following video
http://www.youtube.com/watch?v=kTLhmptHAPc





lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Another Cliper
« Reply #1 on: September 04, 2009, 06:08:17 pm »
Hi Prof,

i been exploring the codes here for embedding the "blue object" into another vernier calipers applet.

i am puzzled how u make the blue object push the right internal jaw on both move together.

i can't locate the code for that "behavior".

chance to advise? thanks!

reference your codes under fixed constraints:
if(ox < oxmin+w/2)ox=oxmin+w/2;
else if(ox > x+w)ox=x+w;

if(oy>oymax)oy=oymax;


if(topone){
 if(x-x1>b)x=x1+b+0.2;
 px[2]=px[1]=x0+2*a+b;
 px[3]=px[4]=x0+a+b;
}

xdmin = ox+d+w/2;
if(oy > oymin && x < xdmin) x=xdmin;
if(x < x1)x=x1;
else if(x > x2)x = x2;



value=(x-x1)/ratio-0.05;





and the blue object has no code ON DRAG;

how is "the blue object push the right internal jaw on both move together" done?
« Last Edit: September 04, 2009, 06:13:15 pm by lookang »

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Another Caliper
« Reply #2 on: September 04, 2009, 06:21:28 pm »
sorry i found it, no worries.

"if(oy > oymin && x < xdmin) x=xdmin;"

i will ask when need again.

quite a challenging task to do remixing alone. ;D