-
Notifications
You must be signed in to change notification settings - Fork 0
/
elcut.c
25 lines (23 loc) · 822 Bytes
/
elcut.c
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
/* Compile with gcc -Wall -o elcut elcut.c
The Lightning Stalker August 28, 2019 */
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
if (argc == 4)
{
printf ("%f\n", (atof(argv[1]) - atof(argv[2])) / atof(argv[1]) * atof(argv[3]));
return (0);
}
else
{
puts ("elcut is a resonant antenna tuning aid.");
puts ("elcut finds the length to cut based on the current and desired frequency.");
puts ("output is the length of an ideal cutoff");
puts ("remember the output is theoretical and subtract from it to avoid mistuning.\n");
puts ("Usage: elcut freq_desired freq_current length_current");
puts ("Example: elcut 28.33 25.55 2516");
puts ("Output should be: 246.893046");
return (1);
}
}