-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurves.c
78 lines (68 loc) · 2.63 KB
/
curves.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
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
/*
* Copyright 2025 Jean-Baptiste M. "JBQ" "Djaybee" Queru
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void main() {
FILE* outputfile;
outputfile = fopen("out/inc/curves.inc", "w");
fprintf(outputfile,
"; Copyright 2025 Jean-Baptiste M. \"JBQ\" \"Djaybee\" Queru\n"
";\n"
"; This program is free software: you can redistribute it and/or modify\n"
"; it under the terms of the GNU Affero General Public License as\n"
"; published by the Free Software Foundation, either version 3 of the\n"
"; License, or (at your option) any later version.\n"
";\n"
"; This program is distributed in the hope that it will be useful,\n"
"; but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"; GNU Affero General Public License for more details.\n"
";\n"
"; You should have received a copy of the GNU Affero General Public License\n"
"; along with this program. If not, see <https://www.gnu.org/licenses/>.\n"
";\n"
"; SPDX-License-Identifier: AGPL-3.0-or-later\n"
"\n"
"; THIS IS A GENERATED FILE.\n"
"; For AGPLv3, this is Object Code, not Source Code.\n"
"; DO NOT EDIT, DO NO SUBMIT.\n"
"\n"
"; See curves.c for more information \n"
"\n"
);
const int p1 = 61, p2 = 41, p3 = 31;
const int h = 112;
const double a = p1;
fprintf(outputfile, "StartCurve1:\n");
for (int i = -p1; i < p1; i++) {
fprintf(outputfile, " .dc.b %d\n", (int)(h*((i/a)*(i/a)+(1-(p1/a)*(p1/a)))));
}
fprintf(outputfile, "EndCurve1:\n");
fprintf(outputfile, "StartCurve2:\n");
for (int i = -p2; i < p2; i++) {
fprintf(outputfile, " .dc.b %d\n", (int)(h*((i/a)*(i/a)+(1-(p2/a)*(p2/a)))));
}
fprintf(outputfile, "EndCurve2:\n");
fprintf(outputfile, "StartCurve3:\n");
for (int i = -p3; i < p3; i++) {
fprintf(outputfile, " .dc.b %d\n", (int)(h*((i/a)*(i/a)+(1-(p3/a)*(p3/a)))));
}
fprintf(outputfile, "EndCurve3:\n");
fclose(outputfile);
}