Calculate largest rectangle in a rotated rectangle

后端 未结 8 2288
你的背包
你的背包 2020-11-28 03:20

I\'m trying to find the best way to calculate the biggest (in area) rectangle which can be contained inside a rotated rectangle.

Some pictures should help (I hope) i

8条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 04:08

    Trying not to break tradition putting the solution of the problem as a picture:)

    enter image description here


    Edit: Third equations is wrong. The correct one is:

    3.w * cos(α) * X + w * sin(α) * Y - w * w * sin(α) * cos(α) - w * h = 0

    To solve the system of linear equations you can use Cramer rule, or Gauss method.

提交回复
热议问题