import javax.vecmath.Vector2d;
public class Main 
{
    public static void main(String[] args) {
        Vector2d p1 = new Vector2d(0, 0);
        Vector2d p2 = new Vector2d(0.5, 0.5);
        System.out.print(p1.angle(p2));
    }
}

NaNとなる。