Loading...
Searching...
No Matches
Beam.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25 */
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30 */
31#ifndef RACK_RADAR_BEAM
32#define RACK_RADAR_BEAM
33
34//
35#include <math.h>
36
37#include <drain/util/Fuzzy.h>
38#include <drain/util/Math.h>
39#include <drain/util/Geo.h>
40
41
42
43namespace rack {
44
45
46class Beam {
47
48public:
49
50 inline
51 Beam(double widthDeg = 1.0){
52 setBeamWidthDeg(widthDeg);
53 }
54
56 double width;
57
58 inline
59 Beam & operator=(const double & widthDeg){
60 setBeamWidthDeg(widthDeg);
61 return *this;
62 }
63
65 inline
66 void setBeamWidthDeg(double width){
67 this->width = width;
68 // fuzzyBell.set(0, 0.5 * width); // half-width
69 // fuzzyBell2.set(0, 0.5 * width); // half-width
70 }
71
73 inline
74 void setBeamWidthRad(double width){
75 setBeamWidthDeg(width * drain::RAD2DEG);
76 }
77
78
80
84 double getBeamPowerDeg(double d) const;
85
87
91 inline
92 double getBeamPowerRad(double d) const {
93 return getBeamPowerDeg(drain::RAD2DEG * d);
94 }
95
96
101 // A fuzzy beam power model, with +/- 0.1 degree beam "width".
102 // drain::FuzzyBell<double> fuzzyBell;
103
104 // A fuzzy beam power model, with +/- 0.1 degree beam "width".
105 // drain::FuzzyBell2<double> fuzzyBell2;
106 //drain::FuzzyBell<double> beamPower:
107
108
109};
110
111
112} // ::rack
113
114
115#endif
116
117// Rack
Definition Beam.h:46
void setBeamWidthDeg(double width)
Set beam width in degrees.
Definition Beam.h:66
double getBeamPowerRad(double d) const
Gaussian beam power.
Definition Beam.h:92
void setBeamWidthRad(double width)
Set beam width in radians.
Definition Beam.h:74
double width
Beam width in degrees.
Definition Beam.h:56
double getBeamPowerDeg(double d) const
Gaussian beam power.
Definition Beam.cpp:44
Definition DataSelector.cpp:44