-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.cpp
More file actions
executable file
·52 lines (45 loc) · 1.11 KB
/
try.cpp
File metadata and controls
executable file
·52 lines (45 loc) · 1.11 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
48
49
50
51
52
#include <iostream>
#include <math.h>
const int len = 5;
using namespace std;
class poop{
public:
poop():val1(0),val2(0.0),str1("what?"){};
poop(int a, double b, char* c):val1(a), val2(b), str1(c){};
~poop(){};
int val1;
double val2;
char* str1;
};
int main()
{
/*
poop P(1,1.2f,"who?"), *ptr, ob;
cout << ob.val1 << ", " << ob.val2 << ", " << ob.str1;
ptr = &P;
cout << ptr->val1 << ", " << ptr->val2 << ", " << ptr->str1;
cout << endl;
*/
double out[2][2*len+1] = {0.0};
double x = 5.0;
double y = x;
double gx = 0.2169;
double gy = 0.9762;
for (int i = -len; i <= len; i++){
out[0][i+len] = x+i*gx;
out[1][i+len] = y+i*gy;
}
int dline[2][2*len+1] = {0};
for (int i = 0; i < 2*len+1; i++){
dline[0][i] = (int)(out[0][i]+0.5);
dline[1][i] = (int)(out[1][i]+0.5);
}
for (int i = 0; i < 2*len+1; i++){
cout << out[0][i] << ", " << out[1][i] << endl;
}
cout << endl;
for (int i = 0; i < 2*len+1; i++){
cout << dline[0][i] << ", " << dline[1][i] << endl;
}
return 0;
}