My preferred method would involve utilizing SVG and implementing AnimateTransform to achieve the desired rotation of the line.
AnimateTransform offers the capability to rotate an object around a specific point, allowing for precise control over the rotation. By anchoring the rotation to the center of a circle, you can easily manipulate the angle of the line.
<svg viewBox='0 0 100 100' xmlns="http://www.w3.org/2000/svg">
<circle fill='transparent' stroke='black' cx='50' cy='50' r='35' />
<line stroke='red' x1='50' x2='85' y1='50' y2='50'>
<animateTransform
attributeName='transform'
from='0 50 50'
to='360 50 50'
dur='1.5s'
repeatCount='indefinite'
attributeType='xml'
type='rotate' />
</line>
</svg>
This approach eliminates the need for CSS or JavaScript to achieve the desired effect.