Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. ${startX} ${startY}
  2.  
  3. let cumulativePercent = 0;
  4.  
  5. function getCoordinatesForPercent(percent) {
  6. const x = Math.cos(2 * Math.PI * percent);
  7. const y = Math.sin(2 * Math.PI * percent);
  8. return [x, y];
  9. }
  10.  
  11. const [startX, startY] = getCoordinatesForPercent(cumulativePercent);
  12.  
  13. const pathData = [
  14. `M ${startX} ${startY}`, // Move
  15. `A 1 1 0 ${largeArcFlag} 1 ${endX} ${endY}`, // Arc
  16. `L 0 0`, // Line
  17. ].join(' ');
  18.  
  19. const pathData = [
  20. `M` + startX + ` ` + startY,
  21. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement