-
Notifications
You must be signed in to change notification settings - Fork 7
/
Exercise 12
43 lines (35 loc) · 1.16 KB
/
Exercise 12
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
// -----------------------------------------------------------------------------
//
// Chapter 13 - Exercise 12
/*
Draw a circle. Move a mark around on the circle (let it move a bit each time
you hit the "Next" button).
*/
// https://github.com/l-paz91/principles-practice/tree/master/Graphics%20Files
// -----------------------------------------------------------------------------
//--INCLUDES--//
#include "Simple_window.h"
#include "Graph.h"
using namespace Graph_lib;
typedef Graph_lib::Circle C;
// -----------------------------------------------------------------------------
int main()
{
Simple_window win{ Point{100,100}, 800, 800, "Exercise 12" };
C c(Point{ 100,100 }, 100);
c.set_color(Color::black);
win.attach(c);
Mark m('x');
m.add(c.getPointOnCircle(0));
m.set_color(Color::red);
win.attach(m);
int angle = 1;
while (win.wait_for_button())
{
m.set_point(0, c.getPointOnCircle(angle));
angle += 10;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------