Finding Points On Perimeter Of a Circle

前端 未结 1 604
陌清茗
陌清茗 2020-12-21 22:02

I need to draw line from the centre of a circle. For this I first chose centre of the image as a circle centre and draw a circle with known radius. After that using parametr

1条回答
  •  隐瞒了意图╮
    2020-12-21 22:13

    sin and cos expect the angle to be in radians. If you provide the angle in degrees, the actual difference will be 6 == 6 - 2 * Pi which is about -16.22°.

    So just calculate the radians from degrees:

    x = cx + r * cos(a * CV_PI / 180.0)
    y = cy + r * sin(a * CV_PI / 180.0) 
    

    0 讨论(0)
提交回复
热议问题