QUESTION IMAGE
Question
in vpython, finish the code to draw a horizontal axis.
origin = vector (0, 0, 0)
axis = cylinder(pos=origin, axis=vector()
Step1: Define horizontal direction in 3 - D
In a 3 - D Cartesian coordinate system, the horizontal direction along the x - axis can be represented by a vector with non - zero x - component and zero y and z components.
Step2: Fill in the vector
The vector for the horizontal axis (assuming the x - axis as the horizontal axis here) should be vector(1, 0, 0) to create a cylinder representing the horizontal axis starting from the origin. So the completed code would be axis = cylinder(pos=origin, axis=vector(1, 0, 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
axis = cylinder(pos=origin, axis=vector(1, 0, 0))