-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsine.cpp
More file actions
66 lines (58 loc) · 1.28 KB
/
Copy pathsine.cpp
File metadata and controls
66 lines (58 loc) · 1.28 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <cmath>
#include "defines.hpp"
using namespace std;
#define START 0.0
#define END (2.0 * PI)
#define PNT 64
#define STEP ((END - START) / PNT)
#define XA 14
#define YA 10
int main(){
int row, column;
win();
CLS;
LOCATE(2, 25);
cout << "t. sine plot";
// /* the coordinate sys. */
// /* X */
// LOCATE(XA, 1);
// for (column = 1; column < 78; ++ column){
// cout << (((column - YA) % 8) ? '\304' : '\305');
// }
//
// /* TOP */
// cout << '\020';
//
// /* Y */
// LOCATE(XA - 1, YA + 64);
// cout << "2PI x";
// for (row = 5; row < 24; ++row){
// LOCATE(row, YA);
// cout << '\305';
// }
// LOCATE(4, YA); cout << "\306 sin(x)";
// LOCATE(XA-8, YA+1); cout << " 1";
// LOCATE(XA+8, YA+1); cout << " -1";
/* ------------------------- */
int begpt = 10;
while(begpt <= 50){
int endpt = begpt + PNT;
for (column = begpt; column <= endpt; ++column){
double x = (column - YA) * STEP;
row = (int)(XA - 8 * sin(x) + 0.5);
LOCATE(row, column);
cout << '*';
}
// LOCATE(25, 1);
// Sleep(50);
++begpt;
}
return 0;
}
/* useful char.
\020
\304
\305
\036
*/