A Discrete-Event Network Simulator Home Tutorials  ▼ Docs    ▼ Develop ▼ API
ns3::Vector3D Class Reference

a 3d vector More...

`#include "vector.h"`

## Public Member Functions

Vector3D (double _x, double _y, double _z)

Vector3D ()
Create vector (0.0, 0.0, 0.0) More...

## Public Attributes

double x
x coordinate of vector More...

double y
y coordinate of vector More...

double z
z coordinate of vector More...

## Friends

double CalculateDistance (const Vector3D &a, const Vector3D &b)

std::ostream & operator<< (std::ostream &os, const Vector3D &vector)
Output streamer. More...

std::istream & operator>> (std::istream &is, Vector3D &vector)
Input streamer. More...

## Related Functions

(Note that these are not member functions.)

typedef Vector3D Vector

## Detailed Description

a 3d vector

Vector3D Attribute

Definition at line 38 of file vector.h.

## Constructor & Destructor Documentation

 ns3::Vector3D::Vector3D ( double _x, double _y, double _z )
Parameters
 [in] _x X coordinate of vector [in] _y Y coordinate of vector [in] _z Z coordinate of vector

Create vector (_x, _y, _z)

Definition at line 47 of file vector.cc.

References NS_LOG_FUNCTION.

 ns3::Vector3D::Vector3D ( )

Create vector (0.0, 0.0, 0.0)

Definition at line 55 of file vector.cc.

References NS_LOG_FUNCTION.

## Friends And Related Function Documentation

 double CalculateDistance ( const Vector3D & a, const Vector3D & b )
friend
Parameters
 [in] a One point [in] b Another point
Returns
The cartesian distance between a and b.

Definition at line 78 of file vector.cc.

 std::ostream& operator<< ( std::ostream & os, const Vector3D & vector )
friend

Output streamer.

Vectors are written as "x:y:z".

Parameters
 [in,out] os The stream. [in] vector The vector to stream
Returns
The stream.

Definition at line 97 of file vector.cc.

 std::istream& operator>> ( std::istream & is, Vector3D & vector )
friend

Input streamer.

Vectors are expected to be in the form "x:y:z".

Parameters
 [in,out] is The stream. [in] vector The vector.
Returns
The stream.

Definition at line 102 of file vector.cc.

 typedef Vector3D Vector
related

Vector alias typedef for compatibility with mobility models

Definition at line 166 of file vector.h.

## Member Data Documentation

 double ns3::Vector3D::x

x coordinate of vector

Definition at line 56 of file vector.h.

 double ns3::Vector3D::y

y coordinate of vector

Definition at line 60 of file vector.h.

 double ns3::Vector3D::z

z coordinate of vector

Definition at line 64 of file vector.h.

Referenced by ns3::CalculateDistance(), ns3::operator<<(), ns3::operator>>(), and showPosition().

The documentation for this class was generated from the following files: