-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathelectromag.cpp
More file actions
48 lines (38 loc) · 1.53 KB
/
Copy pathelectromag.cpp
File metadata and controls
48 lines (38 loc) · 1.53 KB
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
/*
Electromagnetic Functions and Definitions for nec2++
Copyright (C) 2006 Timothy C.A. Molteno
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
*/
#include "electromag.h"
nec_float em::constants::permittivity = 8.854e-12;
nec_float em::constants::permeability = four_pi() * 1.0e-7;
nec_float em::speed_of_light() // was (CVEL in old nec2) but we have changed it to be in meters per second
{
nec_float ret = 1.0 / sqrt(permeability() * permittivity());
return ret; // 299.8e6;
}
nec_float em::impedance() // was (ETA in old nec2)
{
nec_float ret = sqrt(permeability() / permittivity());
return ret; // 376.8
}
nec_float em::inverse_impedance() // was (RETA in old nec2)
{
nec_float ret = 1.0 / em::impedance();
return ret; // 2.654420938E-3;
}
nec_float em::impedance_over_2pi() // was (59.958 in old nec2)
{
nec_float ret = em::impedance() / two_pi();
return ret; // 59.958
}