Rotation of 3D vector?(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矢量的旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:3D矢量的旋转?
基础教程推荐
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
