I\'ve seen a few questions dancing around this, so I hope this isn\'t too redundant. Ideally, I\'d like an image/svg+xml
which scales to 100% of it\'s container.
C
Giel Berkers' solution in Javascript would be:
// angle can be 0 to 360
var anglePI = (angle) * (Math.PI / 180);
var angleCoords = {
'x1': Math.round(50 + Math.sin(anglePI) * 50) + '%',
'y1': Math.round(50 + Math.cos(anglePI) * 50) + '%',
'x2': Math.round(50 + Math.sin(anglePI + Math.PI) * 50) + '%',
'y2': Math.round(50 + Math.cos(anglePI + Math.PI) * 50) + '%',
}