Look at the code to the left. You will see a line of code on line to that creates the sphere. The sphere command has three parts to it in this line: the position, the radius, and the color.
The position decides where the center of the sphere will be (this means the sphere will expand outward from this point)
The radius decides how big the radius of the sphere will be and how far it will expand outward from the position you set before
The color decides what the color of the sphere will be. You can see a list of colors you can choose from here
Click on the play button (▷) at the top of the code. The program should run so you see a white sphere at the center of a xyz-coordinate plane. You should see that the coordinates in Vpython are in a (x, y, z) notation. After you've seen the code, you can go back and modify it. Try out the following modifications.
Change the where the sphere is at. You can do this by changing the position. If you modify the position of the sphere so it says "pos = vec(3,0,0)", you should see that the sphere moves to the right three spaces (or +3 on the x-axis). If you change the y-coordinate you should see a change either up (positive) or down (negative), and if you change the z-coordinate you should see a change either closer (positive) or farther (negative)
Change the radius of the sphere, you should be able to see how you can modify how large the sphere is by making the radius bigger or smaller
Change the color of the sphere. You can do this by changing the color after the command "color = color.(fill in the color)"
Look at the code to the right. You will see a line of code on line to that creates an arrow. The arrow command has three parts to it in this line: the position, the axis, and the color.
The position decides where the tail (start) of the arrow will be
The axis decides which direction the arrow will face. Remember this not the end point of the arrow. This is the most important part of the arrow and is very useful in our code
The color decides what the color of the arrow will be. You can see a list of colors you can choose from here
Click on the play button (▷) at the top of the code. The program should run so you see a white arrow at the center of a xyz-coordinate plane facing to the right. The reason it is facing right is because the axis of the arrow is vec(5,0,0) which means the head (end) of the arrow will be 5 units to the right of the starting position (0,0,0). After you've seen the code, you can go back and modify it. Try out the following modifications.
Change the where the arrow begins. You can do this by changing the position. If you modify the position of the arrow so it says "pos = vec(3,0,0)", you should see that the beginning of the arrow moves to the right three spaces (or +3 on the x-axis). If you change the y-coordinate you should see the beginning of the arrow move either up (positive) or down (negative), and if you change the z-coordinate you should see the beginning of the arrow move either closer (positive) or farther (negative)
Change the axis of the arrow. This will change which way the arrow faces. You should see that you can move the end of the arrow to move just like you did with the beginning of the arrow.
Change the color of the arrow. You can do this by changing the color after the command "color = color.(fill in the color)"
Look at the code to the left. You will see a line of code on line to that creates a box. The box command has three parts to it in this line: the position, the size, and the color.
The position decides where the middle of the box will be
The size decides how large the box will be. It starts at the center and will spread equally both ways
The color decides what the color of the box will be. You can see a list of colors you can choose from here
Click on the play button (▷) at the top of the code. The program should run so you see a white box at the center of a xyz-coordinate plane. The box's dimensions come from the "size" command. The box is 10 units long in the x-direction (5 units left and 5 units right), 4 units high in the y-direction (2 units up and 2 units down), and 2 units deep in the z-direction (1 unit closer and 1 unit farther). After you've seen the code, you can go back and modify it. Try out the following modifications.
Change the where the center of the box is. You can do this by changing the position. If you modify the position of the box so it says "pos = vec(3,0,0)", you should see that the center of the box has moved to the right three spaces (or +3 on the x-axis). If you change the y-coordinate you should see the center of the box has moved either up (positive) or down (negative), and if you change the z-coordinate you should see the center of the box has moved either closer (positive) or farther (negative)
Change the size of the box. This will change how large the box is. You should be able to see that changing the x-coordinate will make it longer or more narrow, changing the y-coordinate will make it taller or shorter, and changing the z-coordinate will make it wider or not as wide. (Remember that the box expands from the center, so if the x-coordinate is 7, it does not go 7 units in both directions, it goes 3.5 units in both directions for a total of 7)
Change the color of the box. You can do this by changing the color after the command "color = color.(fill in the color)"