Yup, 3D. X,Y and Z coordinates are all used. If you want 2D position only there are a few functions that have been writen that can be useful. Here is one that I did, called DisOverGnd which finds the 2D distance between two objects using only the X and Y coordinates. You call the function like so:
_dis = [_obj1, _obj2] call DisOverGnd
The function is attached.