Saturday, March 21, 2015

Computational Modeling: VPython

Our first assignment was to watch youtube video referring the use of the compiler VPython, and develop some basic designs.

This is the source code to display spheres and arrows.

 This is the output of the source code above.

 This was the second assignment that consisted of assigning attributes to each variable so that we could therefore improve the style of coding and perform more operations

 This is the output of the source code above, connecting each ball by using the relative position vector.

 This is the result of moving one sphere twice its y-distance. The result of that caused the arrows to change, from big to small.

 By using the command, print(variable.attribute), we can see that it prints our desired variable's coordinates into the shell windows.

No comments:

Post a Comment