我有下面的代码,其中包含使用(路径)和一个圆圈绘制的三角形。我想在所有四个轴上放置三角形45度。我不知道如何在数学上做到这一点。圆的半径可能会有所不同。那么如何将三角形分别放置在四个位置上,如下图所示?(三角形应该是圆圈内的单个像素)。在SVG中放置一定角度的路径
.st0{fill:#F24343;}
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
\t style="enable-background:new 0 0 22 14;" xml:space="preserve">
<style type="text/css">
\t .st0{fill:#F24343;}
</style>
<circle cx="40" cy="40" r="20" fill="green"/>
<path class="st0" d="M22,0H0l9.4,12.8c0.8,1.1,2.4,1.1,3.2,0L22,0z" style="transform: translate(22px,44px) rotate(45deg)"/>
</svg>
<circle cx="40" cy="40" r="20" fill="green"/>
角度值是在'旋转()'函数的第一个参数。你不必做任何数学。 –
明白了@PaulLeBeau谢谢。 :) –