3905's blog

By 3905, history, 9 years ago, In English

Hello my submission here gives WA on test 3 due to precision issues.My question is how to detect playing with doubles would give a WA.Because there are many instances I recall where intended solution was to manipulate with doubles but still there was no precision errors unlike this case.So if someone can help me it would be great.And yeah in above solution I am trying to find all the coordinates first (0,0) & (a1,0) being the first two and then remaining coordinates and then using the standard way of finding area of triangle if coordinates are given.

  • Vote: I like it
  • -4
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by 3905 (previous revision, new revision, compare).

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
    coord[5][1] = coord[4][1] - Math.sin(rad);

I think you meant:

    coord[5][1] = coord[4][1] - a5 * Math.sin(rad);