uchburchakning yuzasi topuvchi funksiya
Page preview (2 pages)
Scroll down 👇About "uchburchakning yuzasi topuvchi funksiya"
914-guruh talabasi ravshanqulov mirjalol dasturlash1 5-amaliy ishi mavzu: funksiyalar. qiymat qaytradigan va qiymat qaytarmaydigan funksiyalar. rekursiv funksiyalar. 11.uchburchakni uchta uchining koordinatalari berilgan. uning yuzasini topuvchi funksiya tuzing. #include #include struct point { double x, y; }; double findtrianglearea(const point& p1, const point& p2, const point& p3) { // uchburchak yuzasini topish uchun heron formulasi double a = std::sqrt(std::pow(p2.x - p1.x, 2) + std::pow(p2.y - p1.y, 2)); double b = std::sqrt(std::pow(p3.x - p2.x, 2) + std::pow(p3.y - p2.y, 2)); double c = std::sqrt(std::pow(p1.x - p3.x, 2) + std::pow(p1.y - p3.y, 2)); // uchburchak yuzasi double s = (a + b + c) / 2; return std::sqrt(s * (s - a) * (s - b) * (s - c)); } int main() …
This file contains 2 pages in DOCX format (243.1 KB). To download "uchburchakning yuzasi topuvchi funksiya", click the Telegram button on the left.