NaN means not a number. So the fact that it prints that means your other ship value may not actually exist. I'm not exactly sure how to fix this.
Make sure you are using the correct naming and spelling.
Try printing the other ships position to the console, it may offer some insight into the issue.