Skip to content

Instantly share code, notes, and snippets.

@ankycheng
Created December 9, 2019 19:35
Show Gist options
  • Select an option

  • Save ankycheng/25b649de6d81ea838b3429848361dcb8 to your computer and use it in GitHub Desktop.

Select an option

Save ankycheng/25b649de6d81ea838b3429848361dcb8 to your computer and use it in GitHub Desktop.
var count = 0;
count += 0.05;
radians = (count%360);
let movement = radians/Math.PI;
x = Math.sin(movement)*this.r*2;
y = Math.cos(movement)*this.r*1.5 - textHeight/2;
ctx.arc(
window.innerWidth / 2 + x,
window.innerHeight / 2 + y,
this.r,
0,
Math.PI * 2,
false
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment