给定起点,每个旋转轴上的角度和方向,计算终点 [英] Given start point, angles in each rotational axis and a direction, calculate end point

查看:211
本文介绍了给定起点,每个旋转轴上的角度和方向,计算终点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个3D坐标的起点,例如(0,0,0).

I have a start point in 3D coordinates, e.g. (0,0,0).

我指向的方向由三个角度表示-每个旋转角度一个(X旋转,Y旋转,Z旋转)(为示例起见,我假设我是其中的一个)带有笔的老徽标乌龟)和我要指向的方向的距离.

I have the direction I am pointing, represented by three angles - one for each angle of rotation (rotation in X, rotation in Y, rotation in Z) (for the sake of the example let's assume I'm one of those old logo turtles with a pen) and the distance I will travel in the direction I am pointing.

我将如何计算终点坐标?

How would I go about calculating the end point coordinates?

对于2D系统,我知道这很简单:

I know for a 2D system it would be simple:

new_x = old_x + cos(angle) * distance
new_y = old_y + sin(angle) * distance

但是我不知道如何将其应用于3个维度

but I can't work out how to apply this to 3 dimensions

我想另一种思考方法是尝试在球体表面上找到一个点,知道您所指向的方向和球体的半径.

I suppose another way of thinking about this would be trying to find a point on the surface of a sphere, knowing the direction you're pointing and the sphere's radius.

推荐答案

基于三个角度,您必须构造3x3旋转矩阵.然后,矩阵的每一列代表局部x,y和z方向.如果您要沿某个本地方向行驶,则将3x3旋转值与方向矢量相乘即可得到全局坐标系中的结果.

Based in the three angles you have to construct the 3x3 rotation matrix. Then each column of the matrix represents the local x, y and z directions. If you have a local direction you want to move by, then multiply the 3x3 rotation with the direction vector to get the result in global coordinates.

我对3D坐标转换做了一些介绍,我认为它将回答您的问题.

I made a little intro to 3D coordinate transformations that I think will answer your question.

这篇关于给定起点,每个旋转轴上的角度和方向,计算终点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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