/usr/include/ns3.26/ns3/angles.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011, 2012 CTTC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Nicola Baldo <nbaldo@cttc.es>
*/
#ifndef ANGLES_H
#define ANGLES_H
#include <ns3/vector.h>
namespace ns3 {
/**
* \brief converts degrees to radians
*
* \param degrees the angle in degrees
*
* \return the angle in radians
*/
double DegreesToRadians (double degrees);
/**
* \brief converts radians to degrees
*
* \param radians the angle in radians
*
* \return the angle in degrees
*/
double RadiansToDegrees (double radians);
/**
*
* struct holding the azimuth and inclination angles of spherical
* coordinates. The notation is the one used in "Antenna Theory - Analysis
* and Design", C.A. Balanis, Wiley, 2nd Ed., section 2.2 "Radiation
* pattern".
* This notation corresponds to the standard spherical coordinates, with phi
* measured counterclockwise in the x-y plane off the x-axis, and
* theta measured off the z-axis.
*
* ^
* z |
* |_ theta
* | \
* | /|
* |/ | y
* +-------->
* / \|
* /___/
* x / phi
* |/
*
*/
struct Angles
{
/**
* default constructor, will initialize phi and theta to zero
*
*/
Angles ();
/**
* this constructor allows to specify phi and theta
*
* \param phi the azimuth angle in radians
* \param theta the inclination angle in radians
*
*/
Angles (double phi, double theta);
/**
* this constructor will initialize phi and theta by converting the
* given 3D vector from cartesian coordinates to spherical coordinates
*
* \param v the 3D vector in cartesian coordinates
*
*/
Angles (Vector v);
/**
* this constructor initializes an Angles instance with the angles
* of the spherical coordinates of point v respect to point o
*
* \param v the point (in cartesian coordinates) for which the angles are determined
* \param o the origin (in cartesian coordinates) of the spherical coordinate system
*
*/
Angles (Vector v, Vector o);
/**
* the azimuth angle in radians
*
*/
double phi;
/**
* the inclination angle in radians
*
*/
double theta;
};
/**
* print a struct Angles to output
*
* \param os the output stream
* \param a the Angles struct
*
* \return a reference to the output stream
*/
std::ostream& operator<< ( std::ostream& os, const Angles& a);
/**
* initialize a struct Angles from input
*
* \param is the input stream
* \param a the Angles struct
*
* \return a reference to the input stream
*/
std::istream &operator >> (std::istream &is, Angles &a);
} // namespace ns3
#endif // ANGLES_H
|