| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:这道计算几何题目里边已知正方形一条对角线上两点坐标如何求另外两点坐标?In Reply To:这道计算几何题目里边已知正方形一条对角线上两点坐标如何求另外两点坐标? Posted by:omllyf at 2009-10-18 20:39:41 //正方形
void DoneSq(Point a, Point c)
{ //已知a c,求b d
Point b, d;
double x,y,mx, my;
mx = (a.x+c.x)/2.0, my = (a.y+c.y)/2.0;
x = a.x - mx; y = a.y - my;
b.x = -y + mx; b.y = x + my;
x = c.x - mx; y = c.y - my;
d.x = - y + mx; d.y = x + my;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator