问题描述
我现在对此有点茫然.我遇到了一个问题,我需要计算围绕中心点的点的位置,假设它们都与中心和彼此等距.
I'm having a bit of a mind blank on this at the moment.I've got a problem where I need to calculate the position of points around a central point, assuming they're all equidistant from the center and from each other.
点的数量是可变的所以它是DrawCirclePoints(int x)
我确定有一个简单的解决方案,但对于我的生活,我就是看不到它:)
The number of points is variable so it's DrawCirclePoints(int x)
I'm sure there's a simple solution, but for the life of me, I just can't see it :)
推荐答案
圆心为 (x0,y0)
半径为 r
的圆上角为 theta 的点code> 是 (x0 + r cos theta, y0 + r sin theta)
.现在选择 theta
值在 0 和 2pi 之间均匀分布.
A point at angle theta on the circle whose centre is (x0,y0)
and whose radius is r
is (x0 + r cos theta, y0 + r sin theta)
. Now choose theta
values evenly spaced between 0 and 2pi.
这篇关于计算圆中点的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!