A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
angles.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2011, 2012 CTTC
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef ANGLES_H
22
#define ANGLES_H
23
24
25
#include <ns3/vector.h>
26
#include <vector>
27
28
namespace
ns3
{
29
30
37
double
DegreesToRadians
(
double
degrees);
38
45
std::vector<double>
DegreesToRadians
(
const
std::vector<double> °rees);
46
53
double
RadiansToDegrees
(
double
radians);
54
61
std::vector<double>
RadiansToDegrees
(
const
std::vector<double> &radians);
62
69
double
WrapTo360
(
double
a);
70
77
double
WrapTo180
(
double
a);
78
85
double
WrapTo2Pi
(
double
a);
86
93
double
WrapToPi
(
double
a);
94
118
class
Angles
119
{
120
public
:
129
Angles
(
double
azimuth,
double
inclination);
130
140
Angles
(Vector v);
141
150
Angles
(Vector v, Vector o);
151
157
void
SetAzimuth
(
double
azimuth);
158
164
void
SetInclination
(
double
inclination);
165
171
double
GetAzimuth
(
void
)
const
;
172
178
double
GetInclination
(
void
)
const
;
179
180
// friend methods
181
friend
std::ostream&
operator<<
(std::ostream& os,
const
Angles
& a);
182
friend
std::istream&
operator>>
(std::istream& is,
Angles
& a);
183
184
static
bool
m_printDeg
;
185
186
private
:
190
Angles
();
191
201
void
NormalizeAngles
(
void
);
202
208
void
CheckIfValid
(
void
)
const
;
209
210
211
double
m_azimuth
;
212
double
m_inclination
;
213
};
214
215
216
}
// namespace ns3
217
218
#endif // ANGLES_H
ns3::Angles::GetInclination
double GetInclination(void) const
Getter for inclination angle.
Definition:
angles.cc:229
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Angles::SetInclination
void SetInclination(double inclination)
Setter for inclination angle.
Definition:
angles.cc:214
ns3::Angles::NormalizeAngles
void NormalizeAngles(void)
Normalize the angle azimuth angle range between in [-M_PI, M_PI) while checking if the angle is valid...
Definition:
angles.cc:236
ns3::WrapTo360
double WrapTo360(double a)
Wrap angle in [0, 360)
Definition:
angles.cc:79
ns3::Angles::operator>>
friend std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:160
ns3::WrapTo2Pi
double WrapTo2Pi(double a)
Wrap angle in [0, 2*M_PI)
Definition:
angles.cc:108
ns3::Angles::m_azimuth
double m_azimuth
the azimuth angle in radians
Definition:
angles.h:211
ns3::Angles::Angles
Angles()
Default constructor is disabled.
Definition:
angles.cc:172
ns3::Angles::m_inclination
double m_inclination
the inclination angle in radians
Definition:
angles.h:212
ns3::WrapTo180
double WrapTo180(double a)
Wrap angle in [-180, 180)
Definition:
angles.cc:93
ns3::WrapToPi
double WrapToPi(double a)
Wrap angle in [-M_PI, M_PI)
Definition:
angles.cc:122
ns3::Angles::CheckIfValid
void CheckIfValid(void) const
Check if Angle is valid or not Warns the user if the Angle is undefined (non-finite azimuth or inclin...
Definition:
angles.cc:251
ns3::RadiansToDegrees
double RadiansToDegrees(double radians)
converts radians to degrees
Definition:
angles.cc:45
ns3::Angles
Class holding the azimuth and inclination angles of spherical coordinates.
Definition:
angles.h:119
ns3::Angles::SetAzimuth
void SetAzimuth(double azimuth)
Setter for azimuth angle.
Definition:
angles.cc:206
ns3::Angles::operator<<
friend std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:137
ns3::Angles::m_printDeg
static bool m_printDeg
flag for printing in radians or degrees units
Definition:
angles.h:184
ns3::Angles::GetAzimuth
double GetAzimuth(void) const
Getter for azimuth angle.
Definition:
angles.cc:222
ns3::DegreesToRadians
double DegreesToRadians(double degrees)
converts degrees to radians
Definition:
angles.cc:38
src
antenna
model
angles.h
Generated on Fri Oct 1 2021 17:02:53 for ns-3 by
1.8.20