Two magnets A and B are identical and these are arranged as shown. Their lengths are negligible in comparison to separation between them. A magnetic needle is placed between the magnets at point P and it gets deflected through an angle θ. The ratio of distances d1 and d2 will be :