This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
以下是适用于任何语言的数学解决方案:
x = x0 + r * cos(theta) y = y0 + r * sin(theta)
x0 和 y0 是中心坐标,r 是半径,< code>theta 以弧度为单位。该角度是从 x 轴逆时针测量的。
x0
y0
r
这是 C# 的代码,特别是如果您的角度以度为单位:
double x = x0 + r * Math.Cos(theta * Math.PI / 180); double y = y0 + r * Math.Sin(theta * Math.PI / 180);
Here's the mathematical solution which can be applied in any language:
x0 and y0 are the coordinates of the centre, r is the radius, and theta is in radians. The angle is measured anticlockwise from the x-axis.
theta
This is the code for C# specifically if your angle is in degrees:
使用毕达哥拉斯定理(其中 x1,y1 是边缘点):
x1 = x + rcos(theta)y1 = y + rsin(theta)
,这看起来像:
x1 = x + radius * Math.Cos(angle * (Math.PI / 180)); y1 = y + radius * Math.Sin(angle * (Math.PI / 180));
其中所有变量都是双精度数,而角度以度为单位
using Pythagoras Theorem (where x1,y1 is the edge point):
in C#, this would look like:
where all variables are doubles and angle is in degrees
doubles
angle
对于原点 (j, k)、半径 r 和角度 t(以弧度表示)的圆:
(j, k)
t
x(t) = r * cos(t) + j y(t) = r * sin(t) + k
For a circle with origin (j, k), radius r, and angle t in radians:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
以下是适用于任何语言的数学解决方案:
x0
和y0
是中心坐标,r
是半径,< code>theta 以弧度为单位。该角度是从 x 轴逆时针测量的。这是 C# 的代码,特别是如果您的角度以度为单位:
Here's the mathematical solution which can be applied in any language:
x0
andy0
are the coordinates of the centre,r
is the radius, andtheta
is in radians. The angle is measured anticlockwise from the x-axis.This is the code for C# specifically if your angle is in degrees:
使用毕达哥拉斯定理(其中 x1,y1 是边缘点):
,这看起来像:
其中所有变量都是双精度数,而角度以度为单位
using Pythagoras Theorem (where x1,y1 is the edge point):
in C#, this would look like:
where all variables are
doubles
andangle
is in degrees对于原点
(j, k)
、半径r
和角度t
(以弧度表示)的圆:For a circle with origin
(j, k)
, radiusr
, and anglet
in radians: