QUESTION IMAGE
Question
in vpython, finish the code to draw a cylinder.
the distance between the center of the two circular bases should be 5 units to the right and 10 units up.
origin = vector (0, 0, 0)
mycylinder = cylinder(pos=origin, axis=vector()
Step1: Identify axis vector
The axis of the cylinder is the vector from the center of one base to the other. Given the displacement is 5 units to the right (x - direction) and 10 units up (y - direction) and assuming the z - direction is 0, the axis vector components are (5, 10, 0).
Step2: Fill in the code
The code should be myCylinder = cylinder(pos=origin, axis=vector(5, 10, 0))
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
(5, 10, 0)