Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- #define PI 3.14159265
- class vector1
- {
- public:
- double x1, y1, x2, y2;
- double length;
- vector1(double x1, double y1, double x2, double y2)
- {
- length = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
- }
- };
- struct vershina
- {
- double x, y;
- };
- double sozdanie(vershina one, vershina two)
- {
- vector1 a(one.x, one.y, two.x, two.y);
- double znach = a.length;
- return znach;
- }
- double ygol (double one, double two, double three)
- {
- double znach;
- znach = (one*one + two*two - three*three)/(2*one*two);
- return znach;
- }
- int main ()
- {
- vershina A, B, C;
- cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
- double *arr = new double[3];
- arr[0] = sozdanie(A, B);
- arr[1] = sozdanie(B, C);
- arr[2] = sozdanie(A, C);
- double *result = new double[3];
- result[0] = acos(ygol(arr[1], arr[2], arr[0]))*180.0/PI;
- result[1] = acos(ygol(arr[0], arr[2], arr[1]))*180.0/PI;
- result[2] = 180 - result[0] - result[1];
- double znach = result[0];
- cout.precision(10);
- for (int i = 0; i < 3; i++)
- {
- if (znach < result[i])
- znach = result[i];
- }
- cout << fixed << znach;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement