distance between wifi-nodes

108 views
Skip to first unread message

Soumya Banerjee

unread,
Mar 27, 2014, 6:51:17 AM3/27/14
to ns-3-...@googlegroups.com




I'm plotting the distance of wifi nodes using the following snippet of code:

Ptr<MobilityModel> mob = nodes.Get(id)->GetObject<MobilityModel>();
Vector pos = mob->GetPosition ();
std::ostringstream oss;
oss <<"for node "<<id<<"  POS: x=" << pos.x << ", y=" << pos.y << std::endl;

corrosponding output :
for node 1  POS: x=-85.2645, y=143.92



is this distance in metres (from the origin) ?




Konstantinos

unread,
Mar 27, 2014, 7:00:07 AM3/27/14
to ns-3-...@googlegroups.com
These are the coordinates of the node (X,Y) - its position. 

Soumya Banerjee

unread,
Mar 27, 2014, 7:06:47 AM3/27/14
to ns-3-...@googlegroups.com
I need to plot the nodes in a map
i want to know what is the distance (in meters) for one unit distance in the coordinate system

Tommaso Pecorella

unread,
Mar 27, 2014, 7:14:06 AM3/27/14
to ns-3-...@googlegroups.com
Nice

shall we also come there and type on the keyboard for you?
You may as well ask to have your house cleaned and dinner cooked while we're at it.

COME ON !

What is the ***** difficulty in calculating a DISTANCE from the node's COORDINATES ?

Shall we do the math for you? It's basic trigonometry. They teach it to 12 years kids !

Soumya Banerjee

unread,
Mar 27, 2014, 7:43:53 AM3/27/14
to ns-3-...@googlegroups.com
I'm asking for the confirmation if the unit of the distance is in meters


Tommaso Pecorella

unread,
Mar 27, 2014, 9:44:11 AM3/27/14
to ns-3-...@googlegroups.com
Well, then be clearer in the question.

Yes, they're meters. We already found some bugs with units conversion confusions, and I'm fairly sure that more could be found. if you find one of those bugs, report it immediately, thanks.

T.
Reply all
Reply to author
Forward
0 new messages