UVA11524 - InCircle

给一个三角形,画出它的内接圆,然后圆与三角形的边会有交点,这些点分别把每条边分成两部分,这两部分的比例也分别给出,

内接圆的半径也知道,求三角形面积。

我的做法:

用海伦公式与半径,给出的比例,用三角形内心的性质及其三角形的面积联立方程

我的代码:

#include<iostream>
#include<map>
#include<string>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int N;
	double s,a,b,c,r,n[10],m[10],x;
	cin>>N;
	while(N--)
	{
		cin>>r>>m[1]>>n[1]>>m[2]>>n[2]>>m[3]>>n[3];
		a=m[1]+n[1];
		b=n[1]+n[1]*n[2]/m[2];
		c=m[1]+m[1]*m[3]/n[3];
		x=2*r*sqrt((a+b+c)/(b+c-a)/(a+c-b)/(a+b-c));
		s=(a+b+c)*x*r/2;
		printf("%.4lf\n",s);
	}
}

Time limit: 2.000 seconds

Problem E

In-Circle

Input: Standard Input

Output: Standard Output

In-circle of a triangle is the circlethat touches all the three sides of the triangle internally. The center of thein-circle of a triangle happens to be the common intersection point of thethree bisectors of the internal angles. In this problem you will
not be askedto find the in-circle of a triangle, but will be asked to do the opposite!!

 
 

You can see in the figure above that the in-circle of triangle ABC touches thesides AB, BC and CA at point P, Q and R respectively and P, Q and R divides AB,BC and CA in ratio m1:n1, m2:n2 and m3:n3 respectively. Given these ratios andthe value of the radius
of in-circle, you have to find the area of triangleABC.

Input

First line of the input filecontains an integer N (0<N<50001), which denotes how many input sets areto follow. The description of each set is given below.

Each set consists of four lines.The first line contains a floating-point number r (1<r<5000), whichdenotes the radius of the in-circle. Each of the next three lines contains two floating-pointnumbers, which denote the values of m1, n1,
m2,n2, m3 and n3 (1<m1, n1,m2, n2, m3, n3<50000)respectively.

Output

For each set ofinput produce one line of output. This line contains a floating-point numberthat denotes the area of the triangle ABC. This floating-point number shouldcontain four digits after the decimal point. Errors less than 5*10-3will be
ignored. Use double-precision floating-point number for calculation.

SampleInput                              Output for Sample Input


2

140.9500536497

15.3010457320 550.3704847907

464.9681681852 65.9737378230

55.0132446384 10.7791711946

208.2835101182

145.7725891419 8.8264176452

7.6610997600 436.1911036207

483.6031801012 140.2797089713


400156.4075

908824.1322


Problemsetter: Shahriar Manzoor

Special Thanks: Mohammad Mahmudur Rahman

时间: 2024-08-12 04:02:17

UVA11524 - InCircle的相关文章

zoj 3806 Incircle and Circumcircle(二分)

题目链接:zoj 3806 Incircle and Circumcircle 题目大意:给定三角形的内接圆半径和外切圆半径,求三角形的三边长. 解题思路:以等腰三角形去构造,确定外切圆半径的时候,内切圆半径的范围为0?3 ̄ ̄√R,二分判断即可. #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; double f (d

Incircle and Circumcircle(二分+几何)浙大月赛zoj3806(详解版)图

Incircle and Circumcircle Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge A triangle is one the basic shapes in geometry. It's a polygon with three vertices and three sides which are line segments. A triangle with vertices A, B, C is denot

UVA1152-4 Values whose Sum is 0(分块)

Problem UVA1152-4 Values whose Sum is 0 Accept: 794  Submit: 10087Time Limit: 9000 mSec Problem Description The SUM problem can be formulated as follows: given four lists A,B,C,D of integer values, compute how many quadruplet (a,b,c,d) ∈ A×B×C×D are

ZOJ 3806 Incircle and Circumcircle

题意:已知三角形的内接圆半径和外接圆半径,求符合的三角形边长 思路:假设是等腰三角形,内接圆半径最大的情况是等边三角形,直接在(0,pi/3)范围内二分底角 #include <iostream> #include <cmath> #include <stdio.h> #include <algorithm> using namespace std; #define eps 1e-10 double pi=2*asin(1.0); int main() {

ZOJ 3806 Incircle and Circumcircle 【几何】【special judge】

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3806 题目大意:给一个三角形的外接圆半径以及内切圆半径,求满足给出条件的三角形的三条边. 题目给出的样例有点坑.......容易误导人 Sample Input 1 2 2 5 9 9 Sample Ouput 3.464101615137754587 3.464101615137754587 3.464101615137754587 6 8 10 NO Sol

UVa 11524 - InCircle

题目:已知一个三角形内切圆的半径r,以及它分三条边的逆时针比例,求三角形面积. 分析:计算几何.利用面积公式联立等式计算即可,这三边为k*a,k*b,k*c. 根据内切圆计算面积S△ABC = r*k(a+b+c)/ 2: 根据海伦公式计算面积S△ABC = sqrt(p(p-a)(p-b)(p-c)) { 其中p = k (a+b+c)/ 2 }: 解出k,求出面积即可. 说明:╮(╯▽╰)╭. #include <algorithm> #include <iostream> #

UVA-1152-4 Values whose Sum is 0---中途相遇法

题目链接: https://cn.vjudge.net/problem/UVA-1152 题目大意: 给出4个数组,每个数组有n个数,问有多少种方案在每个数组中选一个数,使得四个数相加为0. n <= 4000 解题思路: 两重循环求出a + b的所有情况 两重循环求出-c - d的所有情况 枚举a+b的值,在-c-d里面找相同值的数目即可. 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4

几何基础专题

UVA 11437 Triangle Fun UVA 11800 Determine the Shape 四边形判定 UVA 11646 Athletics Track UVA 11817 Tunnelling the Earth 球面距离 UVA 1473 Dome of Circus UVA 11524 InCircle UVA 11731 Ex-circles 旁切圆 UVA 12300 Smallest Regular Polygon UVA 10566 Crossed Ladders

cocos2dx-lua 笔记 &gt;方向控制 v2

控制层 --[[ 控制层 --]] local LayoutUtils = require('app.common.LayoutUtils') local CtrlLayer = class('CtrlLayer', function() return display.newLayer('CtrlLayer') end) --方向按钮的size local btn_dir_w = 265 local btn_dir_h = 265 --方向按钮位置 local btn_dir_x = displ