posts - 74,  comments - 33,  trackbacks - 0
Mayan Pyramid
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 850 Accepted: 84

Description

When a king dies, Mayan people build a pyramid as a monument. The pyramid is a tetrahedron. So the bottom of the pyramid is a triangle. One side of the triangle represents the year of the kings death, another represents the month, and the last represents the day. The height of the pyramid represents the king's age.

In the following picture, we see a Mayan pyramid. We have already known the coordinates of A, B and C. And we know the height of P. Q is the projection of P. Because of the Mayan religion, they want PD2+PE2+PF2 to be as small as possible.

Input

The input consists of one or more test cases ended with EOF. Each line contains one test case. Each test case contains 7 non-negative float numbers meaning the coordinates of A, B, C and the height of P. All numbers are less than 1000.

Output

For each test case, output the coordinates of Q in a single line. Round all numbers to the second digit after the decimal point.

Sample Input

0 0 2 0 1 1.73205 1

Sample Output

1.00 0.58
题目要求使PD2+PE2+PF2最小的点P在底面上的投影Q的坐标。因为高一定了,所以就转化为求使QD2+QE2+QF2最小的点Q,也就是三角形点一点到三边的距离的平方和最小。
这个点是重心的等角共轭点,求等角共轭点的方法:先求出重心关于三边的对称点,由这三个对称点组成的三角形的外心即为所求。
方法就是这样。至于怎么实现就是简单的事情了..计算几何还是很繁琐的啊....
 
posted on 2008-12-29 11:07 KNIGHT 阅读(212) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理


<2008年12月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

常用链接

留言簿(8)

随笔档案

文章档案

Friends

OJ

搜索

  •  

最新评论

阅读排行榜

评论排行榜