NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
January 27, 2021, 11:16:31 am

Peaceful solution is always the best solution. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: Ejs Open source java applet Resolving a Vector in 2 perpendicular directions  (Read 9534 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message on: March 01, 2009, 12:04:14 am »

Resolving a Vector in 2 perpendicular directions by lookang
original source code by hwang fu-kwun, remixed for helping visualization of components

reference:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=634.msg2195#msg2195
http://www.walter-fendt.de/ph14e/forceresol.htm

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!
 resolvevectorlookang.PNG (53.95 KB, 1280x1024 - viewed 457 times.) « Last Edit: December 22, 2010, 01:43:53 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: March 02, 2009, 06:00:50 am »

more

1. added centre of (x,y) to make drawable visible
2. used actual length instead of unit length  xp=x+Math.sqrt(dx2*dx2+dy2*dy2)*Math.cos(Math.atan2(dy2,dx2)-Math.atan2(dy1,dx1))*Math.cos(Math.atan2(dy1,dx1)); // xp = x + component cta1
yp=y+Math.sqrt(dx2*dx2+dy2*dy2)*Math.cos(Math.atan2(dy2,dx2)-Math.atan2(dy1,dx1))*Math.sin(Math.atan2(dy1,dx1)); //
Rcos = R*Math.cos((Math.atan2(dy2,dx2)-Math.atan2(dy1,dx1)));
Rsin = R*Math.cos((Math.atan2(dy2,dx2)-Math.atan2(dy1,dx1)));
4. change the logic of drawing the angle polyon to
dc = (Math.atan2(dy2,dx2)-Math.atan2(dy1,dx1))/(n-2);// modify to draw from black line sing dx and dy as inputs
px[0]=x; // for drawing angle polygon
py[0]=y; //
for(int i=1;i  c=Math.atan2(dy2,dx2)-(i-1)*dc;  // modify to work drawing from black line
//  if(c<-pi)c+=2*pi; // no necessary
px=x+d*Math.cos(c); //
py=y+d*Math.sin(c); //
}
5. added functions to make slider draggable to control the graphics, thanks Prof Hwang!
 *** There are 7 more attached files. You need to login to acces it! « Last Edit: December 22, 2010, 01:44:04 pm by lookang » Logged
 Pages: [1]   Go Up
Peaceful solution is always the best solution. ...Wisdom