Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- SetConsoleOutputCP(1251);
- int Ax{ 0 }, Ay{ 0 }, Bx{ 9 }, By{ 8 }, Cx{ -9 }, Cy{ 10 };
- double AB{}, AC{}, BC{}, p{}, S{}, ha{}, r{};
- AB = sqrt(pow(Bx - Ax, 2) + pow(By - Ay, 2));
- AC = sqrt(pow(Cx - Ax, 2) + pow(Cy - Ay, 2));
- BC = sqrt(pow(Cx - Bx, 2) + pow(Cy - By, 2));
- p = (AB + AC + BC) / 2;
- S = sqrt(p * (p - AB) * (p - AC) * (p - BC));
- ha = 2 * S / BC;
- r = S / p;
- cout << "Висота hа трикутника: " << ha << endl;
- cout << "Радіус вписаного в трикутник кола r: " << r << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement