Animation 如何在圆的中心点旋转矩形

Animation 如何在圆的中心点旋转矩形,animation,svg,transform,Animation,Svg,Transform,我试着围绕他的中心点旋转矩形,但我不明白它是如何工作的。 svg中是否有简单的代码使问题没有Cos-Sin函数或复杂的代码。 我尝试了很多测试后,我终于成功了,但如果我想调整复角的大小或将其移动到中心页面都是混乱的,你能告诉我怎么做吗? 谢谢 我的代码: <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <rect x="10" y="10" height="100" width="100" sty

我试着围绕他的中心点旋转矩形,但我不明白它是如何工作的。 svg中是否有简单的代码使问题没有Cos-Sin函数或复杂的代码。 我尝试了很多测试后,我终于成功了,但如果我想调整复角的大小或将其移动到中心页面都是混乱的,你能告诉我怎么做吗? 谢谢

我的代码:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="10" y="10" height="100" width="100"
         style="stroke:#FF0000; fill: #9C4100">

        <animateTransform
            attributeName="transform"
            begin="0s"
            dur="40s"
            type="rotate"
            from="0 60 60"
            to="360 60 60"
            repeatCount="1" 
        />
    </rect>
<circle id="pointA" cx="60" cy="60" r="48" />
</svg>​

将图像居中于origo上,并将其“变换”到所需位置。 我相信你想要这样的东西

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
 <g transform="translate(250,200)">
   <rect x="-50" y="-50" height="100" width="100"
     style="stroke:#FF0000; fill: #9C4100">

    <animateTransform
        attributeName="transform"
        begin="0s"
        dur="20s"
        type="rotate"
        from="0"
        to="360"
        repeatCount="1" 
    />
   <animateTransform attributeName="transform"
    type="scale" from="1" to="2" 
    additive="sum" begin="0" dur="20s" fill="freeze"/>
  </rect>
  <circle id="pointA" cx="0" cy="0" r="48" />
</g>
</svg>

谢谢,这就是我要找的