Advertisement
otorp2

polar to cartesian

Mar 15th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1.  
  2. extends Node2D
  3.  
  4. var r = 75
  5. var theta = 0
  6.  
  7.  
  8. func _ready():
  9. set_process(true)
  10.  
  11. pass
  12. func _process(delta):
  13. update()
  14.  
  15. func _draw():
  16. var x = r * cos(theta)
  17. var y = r * sin(theta)
  18. # x = x + speed
  19. draw_circle(Vector2(x + 100,y + 100),10,Color(255,255,255))
  20. theta += .02
  21.  
  22. print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement