英文:
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
我发现解决等价问题稍微容易一些:
使用一些三角学和几何相似性,问题归结为如下找到点:
- 计算点c,d:c = Lsin(theta),d = Lcos(theta):(51.30, 140.95)
- 使用三角学和角度相似性:tan(theta) = (f-d)/(c-e),我们也知道f=L,所以我们得到e = 26.45
- 同样使用三角学,tan(theta) = (f-h)/(g-e),f=L,g=L,所以我们得到h = 105.03
- a = L – h = 44.97
- 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)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论