Determining the elongation of a rod in different gravitational fields of a black hole