Since distance are equal :
⇒ (sinθ−1)2+cos2θ=(sin2θ−1)2+cos2θ
⇒ sin2θ−1=±(sinθ−1)
⇒ sin2θ=sinθ or sin2θ+sinθ=2
∴ sinθ=0 or sinθ=1
sinθ=1 is not possible as points become coincident in this case
∴ sinθ=0 ⇒ A(0,1) and B(0,−1) or B(0,1) and A(0,−1)
⇒ AB=2 units