If you use the SVG transform attribute rather than trying to code it yourself with javascript, all you need to do is center your shape with (0, 0) as the pivot.
For instance, in the example below, the center of the initial arc in the path is at the origin. The animation applies to that element, so it appears to spin in place, with the circle stationary. The translation on the containing group moves the center point of the rotation to the center of the image.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<g transform="translate(32, 32)" stroke="navy" fill="none">
<path d="M -1 1.732 a 2 2 0 1 1 2 0 v 24 a 1 1 0 0 1 -2 0 Z">
<animateTransform attributeName="transform" type="rotate"
from="0" to="360" dur="1s" repeatDur="indefinite"/>
</path>
</g>
</svg>
The only calculation there is the 1.732 to get the center of the circle, the transformation matrix handles the angles. Note, you don't have to use SMIL with SVG, changing the angle from a javascript timeout works fine too.