计算圆的内接三角形的问题,怎么用C语言的程序的编写技术的过程怎么实现的方法是什么

Problem Description
Joe's landscaping company specializes in gardens for computer geeks who have just had their company go public. One of his signature features is a round pool surrounded by a tiled patio in the form of an equilateral triangle where the edge of the pool is tangent to each side of the triangle at its midpoint.

Unfortunately, some of Joe's customers are not satisfied with an equilateral triangle, usually in the center of the garden. Some want it in a corner or next to a slope or some other layout. Joe would like the option of offering arbitrary triangular patios with an elliptical pool which is tangent to each side at the center of the side. For example:

Joe knows how to draw an ellipse by putting two stakes in the ground (at the foci of the ellipse), tying a rope between them and dragging a marker stick inside the rope. What Joe would like is for the customer to determine where the corners of the triangle will be and then measure the location of the triangle vertices and compute where to put the stakes and how long to make the rope.

Write a program, which takes as input the three vertices (x1, y1), (x2, y2) and (x3, y3) of a triangle and computes an ellipse inscribed in the triangle, which is tangent to each side of the triangle at its midpoint. The output is the coordinates of the two foci of the ellipse and the length of the rope (which is the sum of the distances from the foci to any point on the ellipse.

Input
The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of data sets that follow. Each data set consists of a single line of input containing 6 space separated floating point numbers x1 y1 x2 y2 x3 y3 giving the coordinates of the vertices of a triangle.

Output
For each data set, you should generate one line of output with the following values: The data set number as a decimal integer (start counting at one), a space and five floating point values accurate to two decimal places each separated by a single space. The values are fx1 fy1 fx2 fy2 rl where (fx1, fy1) is one focus of the ellipse, (fx2, fy2) is the other focus of the ellipse and rl is the sum of the distances from the foci to any point on the ellipse (e.g. the length of the rope). The foci should be listed in increasing lexicographical order (i.e. fx1 ≤ fx2 and if fx1 = fx2, fy1 ≤ fy2). Note that in the case the ellipse is a circle, the two foci are the same (e.g. the center of the circle).

Sample Input
3
100 100 200 273.2051 300 100
100 100 100 300 300 100
100 200 100 300 300 100

Sample Output
1 200.00 157.71 200.00 157.76 115.47
2 119.53 213.81 213.81 119.53 163.30
3 103.94 253.14 229.40 146.86 170.51

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

2
C语言打印正三角形,使用/\_
1
符号三角形,用C语言实现,怎么实现
2
c语言简单题求解三角形问题
1
如何使用C语言在屏幕上打印一个符号构成的三角形
1
这个问题,用C语言输出构成的最大的三角形的面积,结果保留两位小数。
0
三角形矩阵的求和的算法,如何利用C语言的办法计算三角形和
1
以直角三角形的方式打印输出杨辉三角,怎么利用C语言的方式计算?
0
一个算法要求在这些点里寻找三个点,使他们构成的三角形拥有的面积最大,用C语言怎么实现
1
三角形各个边长的组合的判断的算法问题,如何运用C程序设计技术来实现
0
使用C语言编程工具,输出构成的最大的三角形的面积,结果保留两位小数
0
计算一共存在多少个三角形的问题,采用C语言编程开发的程序编写的思路的实现?
0
输出构成的最大的三角形的面积,结果保留两位小数,运用C语言的实现的方式的思路
0
算法问题用线段如何构成三角形,怎么利用C语言的程序的代码的编制实现程序?
0
寻找3个点,构成的三角形拥有的面积最大,怎么采用C语言的程序的代码的编写的过程去实现的呢?
0
三角形输出n和符号三角形的个数,利用C语言的程序的代码的编写途径的一个实现?
1
判断一下能不能组成一个三角形输入边长,怎么用C语言的代码的格式的方式的思想实现的?
1
三角形的遍历路径算法的问题,怎么使用C 语言的程序的代码设计的思路去实现程序编写的
0
三角形的分区方法,怎么使用C语言的程序的设计的思想编写程序来做的,代码怎么写
0
数字三角形的构造的一个问题,怎么使用C语言的程序的代码编写的过程加以正确实现的
0
计算有多少个不同的符号三角形,使其所含”+“ 和”-“ 的个数相同,用C语言的计算方式是怎么做的