上的球的边缘绘制的点 [英] Plotting a point on the edge of a sphere
问题描述
因此,从闪光背景的我有一些简单的2D触发的正常理解。在2D与圈口,我知道数学上放置使用特定的角度和半径边缘的一个项目。
So coming from a flash background I have an OK understanding of some simple 2D trig. In 2d with I circle, I know the math to place an item on the edge given an angle and a radius using.
x = cos(a) * r;
y = sin(a) * r;
现在如果我有在三维空间中的一个点,我知道我的球体的半径,我知道我要它绕Z轴定位角度和角度,我想周围放置它,比方说,y轴。什么是数学发现的X,在我的3D空间Y,Z坐标(假设我的出身是0,0,0)?我想我可以从圆触发借用数学,但我似乎无法找到一个解决方案。
Now if i have a point in 3d space, i know the radius of my sphere, i know the angle i want to position it around the z axis and the angle i want to position it around, say, the y axis. What is the math to find the x, y and z coordinates in my 3d space (assume that my origin is 0,0,0)? I would think i could borrow the Math from the circle trig but i can't seem to find a solution.
推荐答案
您的三维位置由两个角度(+半径,而你的情况是常数)给出
Your position in 3d is given by two angles (+ radius, which in your case is constant)
x = r * cos(s) * sin(t)
y = r * sin(s) * sin(t)
z = r * cos(t)
这里,取值是绕Z轴的夹角,和 T 是高的角度,从Z测得的向下轴。
here, s is the angle around the z-axis, and t is the height angle, measured 'down' from the z-axis.
这篇关于上的球的边缘绘制的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!