使用drawpie制作多线通过一个角度分开

发布于 2025-01-29 06:08:26 字数 571 浏览 5 评论 0原文

初学者在这里,我需要在不使用DrawPie方法的情况下通过多条线分开轮子。我一直在使用猜测和检查,但是我觉得很多行效率低下,我想知道是否有一种方法可以单独使用它们的角度分开每条线。我需要37个分区,每个分区之间的角度为9.7度。

我尝试提出一个称为“ radiuspoint”的点,并使其x值等于(余弦为9.7)(长度),它们的值等于(9.7)的(Sine of 9.7)(长度),并且然后,我从起点(137,137)绘制了一条线,但是我很难思考长度的价值。起初,我认为这应该是图像的半径,即113,但是该值不能应用于所有37行,因为它只是一条线。

我不确定在这里该怎么做,是否可以找到一个公式来找到线的长度,并仅使用9.7度角&amp&起点(137,137)?还是我应该坚持猜测和检查。我知道前者似乎更加复杂,但我觉得这对我的剩余代码有很大帮助,而不仅仅是猜测&检查。非常感谢任何帮助,非常感谢:)

猜测我在我的方向盘上取得的进度到目前为止 +我的猜测图形检查代码

Beginner here, I need to separate a wheel by multiple lines without using the DrawPie method. I've been using guess and check but I feel so many lines is inefficient and I wanted to know if there's a way I can separate each line just by their angle alone. I need 37 partitions and the angle between each is 9.7 Degrees.

I tried making a Point called "RadiusPoint" and made it's x value equal to the (Cosine of 9.7)(length), and they y value equal to the (Sine of 9.7)(length), and then I drew a line from the start point (137, 137) to that, but I struggle thinking about what the value of length should be. At first I thought it should be the radius of the image, which is 113, but that value can't be applied to all 37 lines because it just makes one single line.

I'm not sure what to do here, is it possible to find a formula to find the length of the line, and make 37 partitions out of it with just the 9.7 degree angle & the start point (137, 137)? Or should I just stick to the guess and check. I know the former seems much more complicated but I feel like it would help me greatly for the rest of my code rather than just guess & checking. Any help would be enormously appreciated, thanks very much :)

The guess&check progress I've made on my wheel so far + my guess&check code for the graphic

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文