Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm 数学题:如何正确拼写“a”;轮换;浮出水面_Algorithm_Math - Fatal编程技术网

Algorithm 数学题:如何正确拼写“a”;轮换;浮出水面

Algorithm 数学题:如何正确拼写“a”;轮换;浮出水面,algorithm,math,Algorithm,Math,希望允许在stackexchange站点之间进行“交叉传递”。。。 有人知道如何解决下面的“数学”问题吗 提前感谢我不是一个喜欢画图的人,但我以前做过类似的事情,就是先有一个遮罩,然后是图像,你需要旋转和blit它们。也就是说,你有一个黑色的炮塔形状的“洞”,旋转和光点匹配旋转你想要为你的炮塔图像 另一个问题是,旋转图像中的像素与原始图像中的像素不对齐,因此必须进行一些插值以使其看起来正确 我认为可能有一些库可以用来为您处理这些内容。您的问题似乎是,您正在相对于炮塔的左上角对炮塔进行blit,

希望允许在stackexchange站点之间进行“交叉传递”。。。 有人知道如何解决下面的“数学”问题吗


提前感谢

我不是一个喜欢画图的人,但我以前做过类似的事情,就是先有一个遮罩,然后是图像,你需要旋转和blit它们。也就是说,你有一个黑色的炮塔形状的“洞”,旋转和光点匹配旋转你想要为你的炮塔图像

另一个问题是,旋转图像中的像素与原始图像中的像素不对齐,因此必须进行一些插值以使其看起来正确


我认为可能有一些库可以用来为您处理这些内容。

您的问题似乎是,您正在相对于炮塔的左上角对炮塔进行blit,而实际上您想要相对于实际炮塔的中心对其进行blit。现在,假设你的炮塔的中心在
x_1
y_1
,顺时针旋转
theta
度应该会给你一个位于
x_2=x_1*cos(theta)
y_2=y_1*sin(theta)
的“新”中心。然后,您必须将其与位于
13,13
的转塔孔中心对齐。这应该不是问题(请记住,我对C#不是很精通,所以这在语法上可能是不正确的):

其中,
x1
y1
是“
坦克炮塔长.png
”中炮塔中心的坐标


我也会的。

我认为这是不允许的,因为内容重复和分散。你好,谢谢。我向炮塔开火,尊重坦克。姿势(13+this.X)。。。“此”指储罐表面。有了这些新的信息,你能帮我“修正”震源,使我的炮塔在炮眼坦克的“中心”闪烁吗?(不是油箱的中心..但孔保持在13,13)。非常感谢。基本上,将13替换为坦克表面上孔的中心(因为该孔的中心不在13,13),并将
x1
/
y1
替换为炮塔表面上实际炮塔的中心,看起来粗糙11,11。
Point posTurret = new Point(13 + this.X - x1*Math.cos(cannonangle),
                            13 + this.Y - y1*Math.sin(cannonangle));