如何使一个点绕一条直线,3D [英] How to Make a Point Orbit a Line, 3D

查看:30
本文介绍了如何使一个点绕一条直线,3D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本质上,我想找到环绕空间中一点的环的方程,该环垂直于远离该点的法线.

Essentially, i want to find the equation of the ring that circles a point in space, this ring is perpendicular to a normal away from this point.

我有一条线,以2个点的形式,L1L2

I have a line, in the form of 2 points, L1, L2;

我有L1->L2的法线,N;

I have the normal from L1->L2, N;

我有一个垂直于 L1->L2 的平面,L1 位于该平面上.ax + by + cz = d;

I have the plane that is normal to L1->L2, which L1 lies on. ax + by + cz = d;

我有距离 L1 的半径,R;

I have the radius away from L1, R;

-> 我想制作一个点V,绕这条线绕点L1;

-> I want to make a point V, orbit this line around point L1;

我想我必须在这个平面上做一个以L1为原点的圆方程.我不知道如何将 2d 方程绘制到 3d 平面上.

I think I have to make a circular equation in this plane with L1 as the origin. I have no idea how to plot a 2d equation onto a 3d plane.

或者也许有人知道如何以另一种方式做到这一点,交叉产品或其他什么?

Or maybe someone knows how to do do this another way, cross products or something?

推荐答案

这个问题实际上需要一个非平凡的解决方案.假设您有 U = normalize(L2 - L1) 和两个单位向量 V 和 W,使得 U、V、W 成对正交.

This problem actually requires a nontrivial solution. Suppose you have U = normalize(L2 - L1) and two unit vectors V and W such that U, V, W are pairwise orthogonal.

然后 f(a) = L1 + R * (V * cos(a) + W * sin(a)) 角度 a 是你想要的圆的方程.

Then f(a) = L1 + R * (V * cos(a) + W * sin(a)) for angles a is the equation for the circle you want.

给定 U 和 V,如何找到 W?W 可以只是他们的交叉产品.

How can you find W given U and V? W can just be their cross product.

给定U,你如何找到V?这是不简单的地方.有一整圈这样的 V 可以选择,所以我们不能只求解the"解.

How can you find V given U? This is where it's not straightforward. There are a whole circle of such V that could be chosen, so we can't just solve for "the" solution.

这是找到这样一个 V 的过程.让 U = (Ux, Uy, Yz).

Here's a procedure for finding such a V. Let U = (Ux, Uy, Yz).

如果 Ux != 0 或 Uy != 0,则 V = normalize(cross(U, (0,0,1)))
否则,如果 Ux != 0 或 Uz != 0,则 V = normalize(cross(U, (0,1,0)))
否则 U = 0,错误

If Ux != 0 or Uy != 0, then V = normalize(cross(U, (0,0,1)))
Else if Ux != 0 or Uz != 0, then V = normalize(cross(U, (0,1,0)))
Else U = 0, error

注意:如果你想让你的点在相反的方向循环,你可以否定 W.

Note: You can negate W if you want your point to cycle in the opposite direction.

这篇关于如何使一个点绕一条直线,3D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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