Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想以圆形路径在 GUI 中移动标签。我希望使用线程来保持速度。谁能告诉我如何做圆周运动?我们应该使用什么逻辑?
您可以使用周长公式:x^2 + y^2 = 半径^2
知道那个公式,如果你知道你想要的半径(常数),你可以做这样的事情(伪代码,我希望你明白):
for (x from initial_x to end_x) { y = Math.sqrt(radius^2 - x^2) draw the label at position (x, y) }