如何Scrunchify角度? [英] How to Scrunchify Angles?

查看:217
本文介绍了如何Scrunchify角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

紧缩危机。

使用从<一个计算href="http://stackoverflow.com/questions/5441061/getting-end-point-in-arcsegment-with-start-x-y-and-startsweep-angles">Getting终点在ArcSegment与开始X / Y和启动+后掠角的,我怎么可能scrunchify或膨胀(化)的角度。

Using the calculations from Getting End Point in ArcSegment with Start X/Y and Start+Sweep Angles, how could I scrunchify or inflate(-ify) angles.

请参阅下面的图片。绿箱子是原​​创。黄色的线条勾勒出什么scrunchy或充气开始/结束角应成,但红线是,如果开始= 169,结束原角= 293保持在碾碎或充气椭圆弧。

See images below. Green box is original. The yellow lines depict what the scrunchy or inflated start/end angle should become, but red line is if the original angle of start=169, end=293 is maintained on the scrunched or inflated elliptical arcs.

我需要一种方法来找出如何创造的开始/结束基于关原值在绿色框​​中输入新的角度和高度/宽度/ xRadius / YRadius为值,蓝色和橙色盒子。

I need a way to figure out how to create the new angles of start/end based off the original values in the green box and the height/width/xRadius/yRadius values in the blue and orange boxes.

宽度揉成一团

有谁知道计算找出什么新的角度应该是什么?

Does anyone know the calculation to figure out what the new angle should be?

推荐答案

我写为preadsheet计算这个。您可以在https://skydrive.live.com/redir?resid=23B7BEDE6527529E!529&authkey=!AGboDW72AySsnK8如果你想。 (这应该产生一个在线的工作版本,但你也应该可以下载。)

I wrote a spreadsheet to calculate this. You can see it at https://skydrive.live.com/redir?resid=23B7BEDE6527529E!529&authkey=!AGboDW72AySsnK8 if you want. (That should produce an online working version, but you should also be able to download it.)

基本技术的工作原理是这样的:

The basic technique works like this:

  1. 制定出X和为unscrunched终点Y坐标
  2. 揉皱那些使用简单的比例,获得X和Y所需端点坐标
  3. 工作从那些角度回

这涉及到相当多的计算。您可以通过以下方式与它使得S preadsheet,但这里有所有的步骤:

This involves quite a few calculations. You can follow it through in that spreadsheet, but here are all the steps:

首先,我把你的角度使用几何坐标约定 - 据我所知,你是从3点顺时针测量,但在几何坐标是比较正常的一个积极的角度是逆时针。所以,你的起点和终点的角度成为191和67度分别。 (我这样做是因为我发现数学不太迷惑这样一轮。))

First, I convert your angles to use coordinate geometry conventions - as far as I can tell, you're measuring clockwise from 3 o'clock, but in coordinate geometry it's more normal for a positive angle to be counterclockwise. So your start and end angles become 191 and 67 degrees respectively. (I did this because I find the maths less confusing this way round.))

接着,在S preadsheet作品出处的半径的起点和终点。下面是我使用的起点和终点的公式:

Next, the spreadsheet works out the radius at the start and end points. Here are the formulae I'm using for the start and end points:

=D2*D3/SQRT(POWER(D3*COS(RADIANS(D4)),2) + POWER(D2*SIN(RADIANS(D4)),2))
=D2*D3/SQRT(POWER(D3*COS(RADIANS(D5)),2) + POWER(D2*SIN(RADIANS(D5)),2))

D2和D3是X和Y半径。 D4为起始角度,和D5是结束角度(如调节至'convential'角)。我在标题为极地形式相对于中心得到这个公式从维基百科项目的椭圆 。该公式需要的角度,​​告诉你椭圆的半径将在这个角度是什么。

D2 and D3 are the X and Y radius. D4 is the start angle, and D5 is the end angle (as adjusted to be 'convential' angles). I got this formula from the Wikipedia item on Ellipses in the section titled "Polar form relative to center". That equation takes an angle and tells you what the ellipse's radius will be at that angle.

接下来,我用它来计算出X和Y的起点和终点的坐标。下面是公式的开始X和Y:

Next I use this to calculate the X and Y coordinates for the start and end points. Here are the formulae for the Start X and Y:

=$B$8*COS(RADIANS(D4)) + D2
=D3-$B8*SIN(RADIANS(D4))

如前所述,D2和D3是X和Y半径,而D 4是启动角。 (公式为最终的X和Y仅与D5看起来是一样的。这样做的原因将在X半径是,如果没有这个号范围从-Xradius至+ Xradius。增加。这意味着它们的范围从0到宽度。Y轴做类似的话,但我倒也让屏幕坐标,因为计算机图形系统常常有这样的倒挂(其中增加Ÿ下山的页面)。是的,这并不完全一致,我倒这一点,但修正的角度.. .sorry!

As mentioned before, D2 and D3 are the X and Y radius, while D4 is the start angle. (The formulae for the end X and Y look the same only with D5. The reason for adding the X radius is that without this numbers range from -Xradius to +Xradius. Adding this means they range from 0 to width. The Y axis does something similar, but I've inverted it to get screen coordinates because computer graphics systems often tend to have this upside down (where increasing Y goes down the page). Yes, it's not entirely consistent that I inverted this but corrected the angle...sorry!

接下来,我们计算蜷缩X和Y以下是公式的起点:

Next we calculate the scrunched X and Y. Here are the formulae for the start point:

=B9/B2*B13
=B10/B3*B14

B9和B10是$ P $对 - 拉伸X和Y在previous步骤中计算出。 B2和B3都是原始宽度和高度,而B13和B14是碾碎的宽度和高度。 (完公式看起来很相似,当然pretty的。)所以,这只是一个简单的缩放操作。

B9 and B10 are the pre-stretch X and Y calculated in the previous step. B2 and B3 are the original width and height, while B13 and B14 are the scrunched width and height. (The end formulae look pretty similar of course.) So this is just a simple scaling operation.

最后,我们计算从这些角度。这里的起始角公式(而结束角几乎是相同的)

Finally, we calculate the angle from these. Here's the start angle formula (and the end angle is almost identical)

=MOD(DEGREES(ATAN2(B16 - $D$13, $D$14-B17)), 360)

在ATAN2函数接受一个X和Y坐标,并告诉你的线的角度从原点到X,Y点。 Excel的弧度工作,所以我们必须将其转换回度(就像我是从度转换为弧度早期公式)。然后我把它MOD 360,以避免任何负面的角度。 ATAN2不会以往产生的值大于PI(即,180度),并产生负的值超出角度。以该模360包装回正数。

The ATAN2 function takes an X and a Y coordinate and tells you the angle of the line from the origin to that X,Y point. Excel works in radians so we have to convert this back to degrees (just like I was converting from degrees to radians in earlier formulae). And then I'm taking it MOD 360 to avoid getting any negative angles. ATAN2 doesn't ever produce values greater than PI (i.e., 180 degrees), and produces negative values for angles beyond that. Taking that modulo 360 wraps it back to a positive number.

然后,最后一步是将其转换回你的顺时针角度系统:

And then the final step is to convert this back to your clockwise angle system:

= 360 - B19

料在拉伸1.88 / 3.4尺寸,我们得到了165.51和287.70度。这并不完全排队与你的号码,但我试图找出你来自哪里得到这些。难道他们用眼睛做了什么?而在2.5 / 2.55喂,我得到171.71和299.51。再次,非常轻微多大区别你的,但不能关闭。

Feeding in your stretched 1.88/3.4 dimensions, we get 165.51 and 287.70 degrees. That doesn't quite line up with your numbers, but I'm trying to work out where you got those from. Are they done by eye? And feeding in 2.5/2.55, I get 171.71 and 299.51. Again, very slightly different from yours, but not off by much.

这篇关于如何Scrunchify角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆