Two thin discs are attached to a horizontal axis, making 300 revolutions per second, 20 cm apart. To determine the speed of the bullet, it was fired in such a way that it pierced both targets at the same distance from the axis of rotation. Find the avarage speed of the bullet between the targets if the penetration points of the targets are offset by 18°.
Despite the complicated description, when we think carefully and imagine the whole situation, the task is very simple. We have the distance traveled, we do not have time and we have to calculate the avarage speed, by definition:
S = v*t
So we need the time. It can be derived from the movement of the disks:
omega = 2 * pi * f
alfa = omega * t
Having these two simple equations, we can very easily derive the time:
t = (alfa)/(2 * pi * f)
#array of zeros (shape of it within parentheses)
zeros_array = np.zeros((3, 3))
#Output:
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
#array of ones
ones_array = np.ones((3, 3))
print(ones_array)
#Output:
[[1. 1. 1.]
[1. 1. 1.]
[1. 1. 1.]]
#empty array
empty_array = np.empty((2, 3))
print(empty_array)
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
#arange method on array
array_arange = np.arange(12)
print(array_arange)
[0 1 2 3 4 5 6 7 8 9 10 11]
array_arrange.reshape(3, 4)
#Output:
[[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11]]
#linspace - equaly spaced data elements
linear_data = np.linspace(11, 20, 5)
#11 - first element
#20 - last element
#5 - number of equidistant elements
print(linear_data)
#Output:
[11. 13.25 15.5 17.75 20. ]
#One dimensional array
one_dimension = np.arrange(15)
print(one_dimension)
#Output:
[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14]
#Two dimensional array
two_dimensions = one_dimension.reshape(3, 5)
print(two_dimensions)
#Output:
[[0, 1, 2, 3, 4],
[5, 6, 7, 8, 9]
[10, 11, 12, 13, 14]
#Three dimensional array
three_dimensions = np.arrange(27).reshape(3, 3, 3)
print(three_dimensions)
#Output:
[[[ 0 1 2 ]
[ 3 4 5 ]
[ 6 7 8 ]]
[[ 9 10 11 ]
[ 12 13 14 ]
[ 15 16 17 ]]
[[ 18 19 20 ]
[ 21 22 23 ]
[ 24 25 26 ]]]