Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:这道计算几何题目里边已知正方形一条对角线上两点坐标如何求另外两点坐标?

Posted by AcCry at 2010-10-04 17:40:46 on Problem 3449
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator