3D矢量的旋转?

2023-07-05Python开发问题
2

本文介绍了3D矢量的旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有两个向量作为 Python 列表和一个角度.例如:

I have two vectors as Python lists and an angle. E.g.:

v = [3,5,0]
axis = [4,4,1]
theta = 1.2 #radian

当围绕轴旋转 v 向量时,获得结果向量的最佳/最简单方法是什么?

What is the best/easiest way to get the resulting vector when rotating the v vector around the axis?

对于轴矢量指向的观察者来说,旋转应该是逆时针的.这称为右手法则

The rotation should appear to be counter clockwise for an observer to whom the axis vector is pointing. This is called the right hand rule

推荐答案

看看http://vpython.org/contents/docs/visual/VisualIntro.html.

它提供了一个 vector 类,该类具有 A.rotate(theta,B) 方法.如果您不想在 A 上调用该方法,它还提供了一个辅助函数 rotate(A,theta,B).

It provides a vector class which has a method A.rotate(theta,B). It also provides a helper function rotate(A,theta,B) if you don't want to call the method on A.

http://vpython.org/contents/docs/visual/vector.html

这篇关于3D矢量的旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10