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

初中几何题,谈不上解析几何,更谈不上计算几何(本来以为算斜率会有精度问题,要变一下形。。。数据太弱了)

Posted by IceKingdom at 2008-09-29 20:25:14 on Problem 1254
program kk;
var testcase:longint;
    x1,y1,x2,y2,x,y,d1,d2,angle,k1,k2:double;

begin
      assign(input,'t1054.in'); reset(input); assign(output,'t1054.out'); rewrite(output);

       readln(testcase);
       while testcase>0 do begin
        dec(testcase);
        readln(x1,y1,d1); d1:=90-d1; while d1<=-90 do d1:=d1+180;
        readln(x2,y2,d2); d2:=90-d2; while d2<=-90 do d2:=d2+180;
        if (d1<>90) and (d2<>90)
         then begin
          k1:=sin(d1*pi/180)/cos(d1*pi/180);
          k2:=sin(d2*pi/180)/cos(d2*pi/180);
          x:=((k1*x1-k2*x2)+y2-y1)/(k1-k2);
          y:=k1*x+y1-k1*x1;
         end
         else begin
          if d1=90
           then begin
            x:=x1;
            y:=y2+sin(d2*pi/180)*(x-x2)/cos(d2*pi/180);
           end
           else begin
            x:=x2;
            angle:=sin(d1*pi/180)/cos(d1*pi/180);
            y:=y1+sin(d1*pi/180)*(x-x1)/cos(d1*pi/180);
           end;
         end;
        writeln(x:0:4,' ',y:0:4);
       end;

      close(input); close(output);
end.


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