How to calculate a point with an given center, angle and radius?

前端 未结 3 495
北恋
北恋 2020-12-28 17:09

In this SO question, someone asked for calculating an angle from three points. I need to do the opposite thing.

I want to draw a clock, and I have tiny tick images.

3条回答
  •  心在旅途
    2020-12-28 17:53

    Your image (center) should be placed at the point (X,Y), where (x,y) are the coordinates of center point, and r is radius

    X = x + (r/2)*cos(angle);
    Y = y + (r/2)*sin(angle); 
    

提交回复
热议问题