计算圆中点的位置 [英] Calculating the position of points in a circle

查看:23
本文介绍了计算圆中点的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在对此有点茫然.我遇到了一个问题,我需要计算围绕中心点的点的位置,假设它们都与中心和彼此等距.

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.

这篇关于计算圆中点的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆