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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// <auto-generated>
// This code was generated by the UnitCodeGenerator tool
//
// Changes to this file will be lost if the code is regenerated
// </auto-generated>
//! # Angle based converters
/// Degrees conversion functions
pub mod degrees {
/// Converts the supplied Degrees value to Radians
/// # Arguments
/// * `value` - The Degrees input value
pub fn to_radians(value: f64) -> f64 {
return value * std::f64::consts::PI/180.0;
}
/// Converts the supplied Degrees value to Gradians
/// # Arguments
/// * `value` - The Degrees input value
pub fn to_gradians(value: f64) -> f64 {
return value * 200.0/180.0;
}
/// Converts the supplied Degrees value to Milliradians
/// # Arguments
/// * `value` - The Degrees input value
pub fn to_milliradians(value: f64) -> f64 {
return value * (1000.0 * std::f64::consts::PI)/180.0;
}
/// Converts the supplied Degrees value to Minute Of Arc
/// # Arguments
/// * `value` - The Degrees input value
pub fn to_minute_of_arc(value: f64) -> f64 {
return value * 60.0;
}
/// Converts the supplied Degrees value to Seconds Of Arc
/// # Arguments
/// * `value` - The Degrees input value
pub fn to_seconds_of_arc(value: f64) -> f64 {
return value * 3600.0;
}
}
/// Gradians conversion functions
pub mod gradians {
/// Converts the supplied Gradians value to Degrees
/// # Arguments
/// * `value` - The Gradians input value
pub fn to_degrees(value: f64) -> f64 {
return value * 180.0/200.0;
}
/// Converts the supplied Gradians value to Radians
/// # Arguments
/// * `value` - The Gradians input value
pub fn to_radians(value: f64) -> f64 {
return value * std::f64::consts::PI/200.0;
}
/// Converts the supplied Gradians value to Milliradians
/// # Arguments
/// * `value` - The Gradians input value
pub fn to_milliradians(value: f64) -> f64 {
return value * (1000.0*std::f64::consts::PI)/200.0;
}
/// Converts the supplied Gradians value to Minute Of Arc
/// # Arguments
/// * `value` - The Gradians input value
pub fn to_minute_of_arc(value: f64) -> f64 {
return value * 54.0;
}
/// Converts the supplied Gradians value to Seconds Of Arc
/// # Arguments
/// * `value` - The Gradians input value
pub fn to_seconds_of_arc(value: f64) -> f64 {
return value * 3240.0;
}
}
/// Milliradians conversion functions
pub mod milliradians {
/// Converts the supplied Milliradians value to Degrees
/// # Arguments
/// * `value` - The Milliradians input value
pub fn to_degrees(value: f64) -> f64 {
return value * 180.0/(1000.0 * std::f64::consts::PI);
}
/// Converts the supplied Milliradians value to Radians
/// # Arguments
/// * `value` - The Milliradians input value
pub fn to_radians(value: f64) -> f64 {
return value / 1000.0;
}
/// Converts the supplied Milliradians value to Gradians
/// # Arguments
/// * `value` - The Milliradians input value
pub fn to_gradians(value: f64) -> f64 {
return value * 200.0/(1000.0 * std::f64::consts::PI);
}
/// Converts the supplied Milliradians value to Minute Of Arc
/// # Arguments
/// * `value` - The Milliradians input value
pub fn to_minute_of_arc(value: f64) -> f64 {
return value * (60.0 * 180.0)/(1000.0 * std::f64::consts::PI);
}
/// Converts the supplied Milliradians value to Seconds Of Arc
/// # Arguments
/// * `value` - The Milliradians input value
pub fn to_seconds_of_arc(value: f64) -> f64 {
return value * (3600.0 * 180.0)/(1000.0 * std::f64::consts::PI);
}
}
/// Minute Of Arc conversion functions
pub mod minute_of_arc {
/// Converts the supplied Minute Of Arc value to Degrees
/// # Arguments
/// * `value` - The Minute Of Arc input value
pub fn to_degrees(value: f64) -> f64 {
return value / 60.0;
}
/// Converts the supplied Minute Of Arc value to Radians
/// # Arguments
/// * `value` - The Minute Of Arc input value
pub fn to_radians(value: f64) -> f64 {
return value * std::f64::consts::PI/(60.0 * 180.0);
}
/// Converts the supplied Minute Of Arc value to Gradians
/// # Arguments
/// * `value` - The Minute Of Arc input value
pub fn to_gradians(value: f64) -> f64 {
return value / 54.0;
}
/// Converts the supplied Minute Of Arc value to Milliradians
/// # Arguments
/// * `value` - The Minute Of Arc input value
pub fn to_milliradians(value: f64) -> f64 {
return value * (1000.0 * std::f64::consts::PI) / (60.0 * 180.0);
}
/// Converts the supplied Minute Of Arc value to Seconds Of Arc
/// # Arguments
/// * `value` - The Minute Of Arc input value
pub fn to_seconds_of_arc(value: f64) -> f64 {
return value * 60.0;
}
}
/// Radians conversion functions
pub mod radians {
/// Converts the supplied Radians value to Degrees
/// # Arguments
/// * `value` - The Radians input value
pub fn to_degrees(value: f64) -> f64 {
return value * 180.0/std::f64::consts::PI;
}
/// Converts the supplied Radians value to Gradians
/// # Arguments
/// * `value` - The Radians input value
pub fn to_gradians(value: f64) -> f64 {
return value * 200.0/std::f64::consts::PI;
}
/// Converts the supplied Radians value to Milliradians
/// # Arguments
/// * `value` - The Radians input value
pub fn to_milliradians(value: f64) -> f64 {
return value * 1000.0;
}
/// Converts the supplied Radians value to Minute Of Arc
/// # Arguments
/// * `value` - The Radians input value
pub fn to_minute_of_arc(value: f64) -> f64 {
return value * (60.0 * 180.0)/std::f64::consts::PI;
}
/// Converts the supplied Radians value to Seconds Of Arc
/// # Arguments
/// * `value` - The Radians input value
pub fn to_seconds_of_arc(value: f64) -> f64 {
return value * (3600.0 * 180.0)/std::f64::consts::PI;
}
}
/// Seconds Of Arc conversion functions
pub mod seconds_of_arc {
/// Converts the supplied Seconds Of Arc value to Degrees
/// # Arguments
/// * `value` - The Seconds Of Arc input value
pub fn to_degrees(value: f64) -> f64 {
return value / 3600.0;
}
/// Converts the supplied Seconds Of Arc value to Radians
/// # Arguments
/// * `value` - The Seconds Of Arc input value
pub fn to_radians(value: f64) -> f64 {
return value * std::f64::consts::PI/(180.0 * 3600.0);
}
/// Converts the supplied Seconds Of Arc value to Gradians
/// # Arguments
/// * `value` - The Seconds Of Arc input value
pub fn to_gradians(value: f64) -> f64 {
return value / 3240.0;
}
/// Converts the supplied Seconds Of Arc value to Milliradians
/// # Arguments
/// * `value` - The Seconds Of Arc input value
pub fn to_milliradians(value: f64) -> f64 {
return value * (1000.0 * std::f64::consts::PI) / (180.0 * 3600.0);
}
/// Converts the supplied Seconds Of Arc value to Minute Of Arc
/// # Arguments
/// * `value` - The Seconds Of Arc input value
pub fn to_minute_of_arc(value: f64) -> f64 {
return value / 60.0;
}
}