QUESTION IMAGE
Question
question # 2
dropdown
in vpython, which line of code creates a ball 10 units up from the center?
ballposition =
myball = sphere(pos = ballposition)
In VPython, to create a ball 10 units up from the center, the position vector should have a y - component of 10 (assuming the up - direction is along the y - axis). The position is typically represented as a vector. In VPython, a common way to represent a 3 - D position is using the vector function. So the correct code for ballPosition would be vector(0, 10, 0) as the x and z components are 0 (assuming the center is at the origin in x and z directions) and the y component is 10 for the upward position.
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
vector(0, 10, 0)