Ad
  • Default User Avatar

    Thank you! :)

  • Default User Avatar

    I did it using polar coordinate system. Each vertex has increasing angle (from 0 to 2PI-0.02 at last point) and not zero distance from (0,0). So, it can't intersect itself.

  • Default User Avatar

    "Your task is to determine the area of a polygon that does not intersect itself and has no holes. You are given the coordinates of its vertices in the double[n][2] array. Coodinates will describe a polygon in counterclockwise order. The input is always valid."

    Wiki: In geometry, a simple polygon is a polygon that does not intersect itself and has no holes.

  • Default User Avatar

    1 So, is it not enough? If algorithm can calculate single random test what is the point for more tests?
    2 & 3. It is poor task description, I think. My fault, thank you.
    4 Done.

  • Default User Avatar

    Removed the test, thank you.