[Ultraviolet A] 11524-incircle (formula derivation)

Source: Internet
Author: User

Drunk.

1) the radius of a triangle is as follows: [(S-A) (s-B) (s-c)/S] ^ (1/2) S = (A + B + C)/22) in the incircle of the right triangle, there are two simple formulas: 1. The sum of the two sides of the right angle minus the oblique side divided by 2, the number is the radius of the incircle: R = (a + B-c)/2 (Note: S is the area of RT △, A and B are the two straight corner edges of RT △, and C is the oblique edges)2. Divide the product of the two sides by the circumference of the right triangle, and the number is the radius of the incircle: R = AB/(A + B + C)

Radius Formula of the incircle: A, B, and C are the three sides of the triangle.

S = (A + B + C)/2;

R = SQRT (S-A) * (S-B) * (s-c)/s );

In this way, we can use an edge to represent the other two sides based on the ratio between the sides, and then bring them into the incircle formula.

Evaluate area using Helen Formula

Area = SQRT (S * (S-A) * (S-B) * (s-c ));

# Include <iostream> # include <cstdlib> # include <cstdio> # include <string> # include <cstring> # include <cmath> # include <vector> # include <queue> # include <stack> # include <algorithm> using namespace STD; const double EPS = 1e-10; # DEFINE _ pI ACOs (-1.0) Double M1, N1, M2, N2, M3, N3; double T1, T2, T3, T4, T5, t6; Double R, B; void Init () {scanf ("% lf", & R); scanf ("% lf ", & M1, & N1, & m2, & N2, & m3, & N3); double T1 = N3/(N3 + m3 ); double t2 = m1/(N1 + M1); double T3 = m3/(N3 + m3); double t4 = n2/(n2 + m2); double k1 = t1/T2; // C = K1 * B double k2 = T3/T4; // A = k2 * B Double K = k1 + k2 + 1; // perimeter = A + B + C = (K1 + k2 + 1) * B; double _ k = K/2; double TT = (_ k-k1) * (_ k-K2) * (_ k-1); B = SQRT (R * r * _ k/TT); double S = _ K * B; double ans = SQRT (S * (S-K1 * B) * (S-B) * (S-K2 * B); printf ("%. 4f \ n ", ANS) ;}int main () {int t; scanf (" % d ", & T); While (t --) {Init ();} return 0 ;}

[Ultraviolet A] 11524-incircle (formula derivation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.