Kenneth-nlogn's blog

By Kenneth-nlogn, 10 years ago, In English

Hello, I recently started studying algorithms in computational geometry, I seem to have problems with the following computational geometry problem, I have searched long and hard but still cant find a solution: it goes: given n points, find the triplicate whose angle is close to 90 as possible. any suggestions will be appreciated.

  • Vote: I like it
  • +5
  • Vote: I do not like it

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

Maximal N is ?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    MAX N = 100000

    • »
      »
      »
      10 years ago, # ^ |
      Rev. 8   Vote: I like it 0 Vote: I do not like it

      An algorithm may work for n ≤ 1000, algorithm. define S as the set contains n given point.

      for p1 in S:
          for p2 in S - {p1}:
              a[i] = Angle(p2p1, Ox)
          using 2 pointers to get the angles whose sum is closest to 90 degree
      

      After some searching, I found a similar question here