NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
January 20, 2021, 05:13:13 am

Last chance is the best chance. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: Another Cliper  (Read 12755 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message on: September 03, 2009, 06:30:55 pm » posted from:Taipei,T\'ai-pei,Taiwan

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).

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
• 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

 caliper2.gif (8.68 KB, 867x457 - viewed 689 times.) Logged
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: September 04, 2009, 05:08:17 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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".

reference your codes under fixed constraints:
Code:
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?
 *** There are 1 more attached files. You need to login to acces it! « Last Edit: September 04, 2009, 05:13:15 pm by lookang » Logged
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #2 on: September 04, 2009, 05:21:28 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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.
 Logged
 Pages: [1]   Go Up
Last chance is the best chance. ...Wisdom