Lab09.py - from_future import division from visual import...

This preview shows page 1 out of 3 pages.

from __future__ import division from visual import * from visual.graph import * scene.y=400 # Turn off autoscaling autoscale=0 # Create objects: ground, cliff, cannon # Ground is at y=0 # Ball initial position is initialPos # Ball initial velocity is initialVel # Ball size is enlarged for viewing. For calculations, consider it to be 2 m diameter # Initial Conditions initialPos = vector(-.6,64.1,0) vball = vector(37,53,0) # Setup the scene ground = box(pos=(0,0,0), length = 1200, height = 1, width = 10, color=color.green) cliff = box(pos=(initialPos.x-40,initialPos.y/2,0), length = ground.length/2+initialPos.x, height = initialPos.y, width = 10, color=color.green) # Make Cannon L=10 wheel = cylinder(pos=initialPos, axis=vector(0,0,1),radius=5, color=color.blue) cannon = cylinder(pos=initialPos, axis=L*vball/mag(vball), radius=1) # Setup ball and trail ball = sphere(pos=initialPos, radius = 1, color=color.red) trail = curve(color=ball.color) # Constants mball = 63.8 # ball's mass (10 kg) g = 9.8 # gravitational acceleration pScale = 0.0125 # scale for momentum arrow fScale = 0.1 # scale for force arrow # Drag constants airDensity = 1.3
Image of page 1
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern