calculate acceleration from xyz