-
Notifications
You must be signed in to change notification settings - Fork 0
/
We_are_command.h
131 lines (93 loc) · 3.27 KB
/
We_are_command.h
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#define _USE_MATH_DEFINES
#include <stdlib.h>
#include <math.h>
#include <iostream>
using namespace std;
#ifndef WE_ARE_COMMAND_H
#define WE_ARE_COMMAND_H
class n_angle
{
private:
double radius, x = 0, y = 0;
int n;
public:
//âîçâðàùàåì ðàäèóñ îïèñàííîé îêðóæíîñòè
double get_radius() const;
//âîçâðàùàåì x êîîðäèíàòó öåíòðà
double get_x() const;
//âîçâðàùàåì y êîîðäèíàòó öåíòðà
double get_y() const;
//âîçâðàùàåì n
int get_n() const;
//ïîëó÷àåì âåëè÷èíó ñòîðîíû n-óãîëüíèêà
double get_side() const;
//ïîëó÷àåì ïëîùàäü n-óãîëüíèêà
double get_area() const;
//ïîëó÷àåì ïåðèìåòð n-óãîëüíèêà
double get_perimeter() const;
//ïåðåìåùåíèå öåíðà â íîâûå êîîðäèíàòû
void move(const double x_, const double y_);
//èçìåíåíèå ðàçìåðîâ íà êàêóþ-ëèáî âåëè÷èíó (ò.å. +- êàêîå-òî ÷èñëî)
void resizing_by_side(const double x);
void resizing_by_rad(const double x);
//ïåðåãðóçêà îïåðàòîðà ñðàâíåíèÿ äâóõ n-óãîëüíèêîâ
bool operator== (const n_angle& n);
//îïðåäåëåíèå ïåðåñå÷åíèÿ äâóõ n-óãîëüíèêîâ
bool crossing(const n_angle& second);
//îïðåäåëåíèå âõîæäåíèÿ n-óãîëüíèêà second â íàø n-óãîëüíèê
bool accessory(const n_angle& second);
//îïðåäåëÿåì êâàäðàò ëè
bool is_it_square();
//êîíñòðóêòîð êëàññà
n_angle(const double rad, const int n_, const double x_ = 0, const double y_ = 0);
//âûâîä ïàðàìåòðîâ
void return_parameters();
};
class ellipse
{
private:
double major_axis, minor_axis, x = 0, y = 0;
public:
//âîçâðàùàåì major_axis
double get_major_axis() const;
//âîçâðàùàåì minor_axis
double get_minor_axis() const;
//âîçâðàùàåì x êîîðäèíàòó öåíòðà
double get_x() const;
//âîçâðàùàåì y êîîðäèíàòó öåíòðà
double get_y() const;
//ïîëó÷àåì ïëîùàäü ýëëèïñà
double get_area() const;
//ïîëó÷àåì ïåðèìåòð ýëëèïñà
double get_perimeter() const;
//ïåðåìåùåíèå öåíðà â íîâûå êîîðäèíàòû
void move(const double x_, const double y_);
//èçìåíåíèå ðàçìåðîâ íà êàêóþ-ëèáî âåëè÷èíó (ò.å. +- êàêîå-òî ÷èñëî)
void resizing(const double x, const double y = 0);
//ïåðåãðóçêà îïåðàòîðà ñðàâíåíèÿ äâóõ ýëëèïñîâ
bool operator== (const ellipse& second);
//îïðåäåëåíèå ïåðåñå÷åíèÿ äâóõ ýëëèïñîâ
bool crossing(const ellipse& second);
//îïðåäåëåíèÿ âõîæäåíèå ýëëèïñà second â íàø ýëëèïñ
bool accessory(const ellipse& second);
//îïðåäåëÿåì êðóã ëè
bool is_it_circle();
//êîíñòðóêòîð êëàññà
ellipse(const double a, const double b, const double x_ = 0, const double y_ = 0);
//âûâîä ïàðàìåòðîâ
void return_parameters();
//ñðàâíèâàåì ïî ïëîùàäè íàø n-óãîëüíèê è ýëëèïñ
friend bool operator== (const n_angle& n, const ellipse& el);
friend bool operator== (const ellipse& el, const n_angle& n);
//îïðåäåëåíèå ïåðåñå÷åíèÿ ýëëèïñà è n-óãîëüíèêà
friend bool crossing(const n_angle& n, const ellipse& el);
friend bool crossing(const ellipse& el, const n_angle& n);
//îïðåäåëåíèå âõîæäåíèÿ ýëëèïñà â n-óãîëüíèê
friend bool accessory(const n_angle& n, const ellipse& el);
friend bool accessory(const ellipse& el, const n_angle& n);
//îïðåäåëåíèå ïðèíàäëåæíîñòè òî÷åê
bool beloning_el(const ellipse& second, const double x, const double y) const;
bool beloning_n(const n_angle& second, const double x, const double y) const;
};
int Sign(double x);
#endif