Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.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
C# 我们如何从变换矩阵中得到x和y?_C#_Math_Matrix_Svg_Transform - Fatal编程技术网

C# 我们如何从变换矩阵中得到x和y?

C# 我们如何从变换矩阵中得到x和y?,c#,math,matrix,svg,transform,C#,Math,Matrix,Svg,Transform,可能重复: 我需要得到一个元素的x/y位置,在SVG中是这样写的: <image y="-421.28461" x="335.27295" id="image2991" xlink:href="file:///C:/Users/tom/Documents/t.jpg" height="369" width="360" transform="matrix(0.22297057,0.97482518,-0.97482518,0.22297057,0,

可能重复:

我需要得到一个元素的x/y位置,在SVG中是这样写的:

<image
   y="-421.28461"
   x="335.27295"
   id="image2991"
   xlink:href="file:///C:/Users/tom/Documents/t.jpg"
   height="369"
   width="360"
   transform="matrix(0.22297057,0.97482518,-0.97482518,0.22297057,0,0)" />

这里给出了
x
&
y
属性,但这并没有给出图像的实际位置。据我所知

变换矩阵
[a,b,c,d,e,f]
e
&
f
分别给出x和y方向的平移轴。但是

问题是这里的
(e&f)
都是0。现在我可以得到这个图像的实际
x
任何
y

假设

x="335.27295"
y="-421.28461"
给出了变换矩阵

a              b          e
c              d          f
0              0          1
有价值

0.22297057     0.97482518 0
-0.97482518    0.22297057 0
0              0          1
知道

  • a、 d分别负责缩放x、y
  • e、 f分别负责转换x,y
你最终会得到的

newX = x * a + e
newY = y * d + f
或者

假设

x="335.27295"
y="-421.28461"
给出了变换矩阵

a              b          e
c              d          f
0              0          1
有价值

0.22297057     0.97482518 0
-0.97482518    0.22297057 0
0              0          1
知道

  • a、 d分别负责缩放x、y
  • e、 f分别负责转换x,y
你最终会得到的

newX = x * a + e
newY = y * d + f
或者


都写满了
x=“335.27295”
y=“-421.28461”
但这不是元素的实际x和y参见SVG文档哦,在应用转换矩阵后,你在寻找x,y吗?好的,我会为你计算它,并发布一个带有示例的答案,给我几分钟时间。它都写满了
x=“335.27295”
y=“-421.28461”
但这不是元素的实际x和y,请参见SVG文档哦,在应用转换矩阵后,您是否在寻找x,y?好的,我将为您计算它,并发布一个带有示例的答案,给我几分钟时间……转换矩阵不是
[[a c e][b d f][0 1]
(即,b和c与您的交换),根据?转换矩阵不应该是
[[a c e][b d f][0 1]
(即,b和c与您的交换),根据?