At time t, the velocity v of an object undergoing simple harmonic motion at the end of a spring is given by the formula
v = A * √ k / m * cos ( √ k / m * t )
Here, m is the mass of the object (in g), k is a constant depending on the spring (in g / s2), A is the maximum distance the object moves, and t is the time (in s).
Write a C program which accepts as inputs a time t, mass m, constant k, and distance A, and which computes the velocity of the object according the formula above.
When running your program, use the following inputs:
t: 0.10 s
m: 36.0 g
k: 400 g / s2
A: 5.0 cm
v = A * √ k / m * cos ( √ k / m * t )
Here, m is the mass of the object (in g), k is a constant depending on the spring (in g / s2), A is the maximum distance the object moves, and t is the time (in s).
Write a C program which accepts as inputs a time t, mass m, constant k, and distance A, and which computes the velocity of the object according the formula above.
When running your program, use the following inputs:
t: 0.10 s
m: 36.0 g
k: 400 g / s2
A: 5.0 cm
Comment