It is only going to be downhill from here

  • NominatedNemesis@reddthat.com
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    It was easy staight forward brtue force:

    Spoiler
    For each possible_rectange Find Max:
       If polygon.contains(rectangle) Then rectangle.area() Else 0
    

    For speed the loop can be run paralelley.

    I had no time to implent the contains myself, but pretty much all languages have a library already.

    • Avicenna@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      yea becomes trivial if one uses a polygon library (I did too) but looking at the actual polygon, one can cook up some clever heuristics to do it quite quickly with some basic checks I think.

      • NominatedNemesis@reddthat.com
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        I’ll check if someone created a guide for the clever solution, cos I’m interested. But I don’t have nearly enough knowledge about geometry to came up with one myshelf. (nor energy after the 10 hour workdays in the last two weeks…)