Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- #include <iomanip>
- using namespace std;
- struct otrezok
- {
- double x1, y1, x2, y2, x, y;
- double length;
- };
- struct vershina
- {
- double x, y;
- };
- double cos_ygla (double ygol)
- {
- double znach;
- znach = cos(ygol*3.141592653/180.0);
- return znach;
- }
- vershina teorema (double cos_ygol, otrezok a, otrezok b)
- {
- vershina znach;
- znach.x = b.length*cos_ygol;
- double n = a.length*a.length + b.length*b.length - 2*znach.x*a.length;
- znach.y = sqrt(n - (znach.x - a.length)*(znach.x - a.length));
- return znach;
- }
- int main ()
- {
- otrezok AB, BC;
- double ygol_B;
- cin >> AB.length >> BC.length >> ygol_B;
- vershina B;
- B.x = 0;
- B.y = 0;
- AB.x = AB.length;
- AB.y = 0;
- vershina C;
- double cos_B = cos_ygla(ygol_B);
- C = teorema(cos_B, AB, BC);
- cout.precision(10);
- cout << fixed << B.x << " " << B.y << endl;
- cout << fixed << AB.x << " " << AB.y << endl;
- cout << fixed << C.x << " " << C.y << " ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement