|
|
вернуться в форумWA#4 - I don't know why AB, AC, BC - Vectors. r - Radius. Arctangent(y, x) - Coprocessor function FPATAN, calculates an angle between vectors A(x, y) and X(1, 0)(using y and x coordinates of the A point). My algorithm: d = Abs(VectorMultiply(AC, BC)) / AB if (d >= r) then Write(Length(AB)) else begin s1 = Sqrt(Length(AC) * Length(AC) - r * r) angle1 = Arctangent(Sqrt(Length(AC) * Length(AC) - d * d), d) - Arctangent(s1, r); s2 = Sqrt(Length(BC) * Length(BC) - r * r) angle2 = Arctangent(Sqrt(Length(BC) * Length(BC) - d * d), d) - Arctangent(s2, r); s = r * (angle1 + angle2) Write(s1 + s + s2) end ----- Am I wrong? Re: WA#4 - I don't know why I think if you'll get following test, then you'll get 4th. 1 2 0 3 3 0 0 0 0 2 The answer is 2.24 (not 2.30) Re: WA#4 - I don't know why Послано Sirko 30 июл 2013 22:44 Thank's Anatoly, that helped me. Don't know, how I've missed this :) |
|
|