旋转后未被占用矩形的尺寸计算

huangapple go评论49阅读模式
英文:

Compute dimension of unoccupied rectangle after rotation

问题

我有一个尺寸为300 x 300像素的白色矩形。我已经将这个矩形顺时针旋转了20度。我想计算a和b的长度。

注:背景上的黑色矩形带有白色边框,也是300 x 300像素。

谢谢!

英文:

I have a white rectangle of size 300 X 300 pixels. I have rotated the rectangle about the origin by 20 degrees clockwise.I would like to compute the length of a and b below.

Note:The background black rectangle with the white border is also 300 X 300 pixels.

Thanks!

旋转后未被占用矩形的尺寸计算

答案1

得分: 1

我发现解决等价问题稍微容易一些:
旋转后未被占用矩形的尺寸计算

使用一些三角学和几何相似性,问题归结为如下找到点:

  1. 计算点c,d:c = Lsin(theta),d = Lcos(theta):(51.30, 140.95)
  2. 使用三角学和角度相似性:tan(theta) = (f-d)/(c-e),我们也知道f=L,所以我们得到e = 26.45
  3. 同样使用三角学,tan(theta) = (f-h)/(g-e),f=L,g=L,所以我们得到h = 105.03
  4. a = L – h = 44.97
  5. b = L – e = 123.55
  • 您可以通过绘制一个正方形(例如在PowerPoint中),复制它,指定您的旋转角度,导出为图像,然后您可以在画图或GIMP中打开并直接测量a和b(根据像素计数适当缩放)。
英文:

I found it a bit easier to solve the equivalent problem:
旋转后未被占用矩形的尺寸计算

Using a bit of trig and geometric similarities, the problem amounts to finding the points as follows:

1) calc point c,d: c = L*sin(theta), d = L *cos(theta) : (51.30, 140.95)
2) using trig and angle similarity: tan(theta) = (f-d)/(c-e), we also know f=L, so we get e = 26.45
3) also using trig, tan(theta) = (f-h)/(g-e), f=L, g=L, so we get h = 105.03
4) a = L – h = 44.97
5) b = L – e = 123.55
  • you can do a check by drawing a square (eg. in powerpoint), copy it, specify your rotation- export to an image then you can open in paint or gimp and measure a and b directly (scaling the pixel count appropriately)

huangapple
  • 本文由 发表于 2023年7月7日 06:11:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76632805.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定