ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1103. Pencils and Circles

Can you help me?
Posted by Tony 16 Oct 2002 16:21
If you know Xi,Yi,Xj,Yj,Xk,Yk,can you calc the <ijk ( < mean jiao ).
if you can,write it to me.Thanks!
Yes,I can.
Posted by Yang Yi 18 Oct 2002 15:20
var
  xi,xj,xk,yi,yj,yk,j1,j2,jiao:real;
begin
  readln(xi,yi,xj,yj,xk,yk);
  if yi=yj then j1:=90 else j1:=arctan(abs(xj-xi)/abs(yj-yi))/pi*180;
  if xj>xi then j1:=360-j1;
  if yj>yi then j1:=180-j1;
  if j1<0then j1:=j1+360;
  if yk=yj then j2:=90 else
  j2:=arctan(abs(xj-xk)/abs(yj-yk))/pi*180;
  if xj>xk then j2:=360-j2;
  if yj>yk then j2:=180-j2;
  if j2<0then j2:=j2+360;
  jiao:=abs(j1-j2);
  if jiao>180then jiao:=360-jiao;
  {jiao is <IJK.}writeln(jiao:0:8)
end.
Thank you from Zimbabwe.
Posted by Stupid Petrov 21 Oct 2002 10:55