Skip to content

Instantly share code, notes, and snippets.

@mohsinrasool
Created February 4, 2016 13:39
Show Gist options
  • Save mohsinrasool/48235fb77d7d1be89f45 to your computer and use it in GitHub Desktop.
Save mohsinrasool/48235fb77d7d1be89f45 to your computer and use it in GitHub Desktop.
Javscript function to create path of circle in SVG
<script type="text/javascript">
function circlePath(cx, cy, r){
return 'M '+cx+' '+cy+' m -'+r+', 0 a '+r+','+r+' 0 1,0 '+(r*2)+',0 a '+r+','+r+' 0 1,0 -'+(r*2)+',0';
}
circlePath (40, 60,30);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment