ball_density vectorized