Back to skills
SKILL.md
Python实现C Quaternion Angleaxis 不使用Numpy Quaternion
ASecurity在Python中实现C#的Quaternion.AngleAxis功能,根据旋转轴和角度生成四元数,且不使用numpy.quaternion库。
- 611 stars
- 0 votes
- 0 copies
- 0 views
- Added November 11, 2026
Security analysis
100/100npx -y skills add ECNU-ICALK/AutoSkill --skill 'python实现c-quaternion-angleaxis-不使用numpy-quaternion' --agent claude-codeAre you the author of Python实现C Quaternion Angleaxis 不使用Numpy Quaternion?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ecnu-icalk-python-c-quaternion-angleaxis-numpy-quaternion-autoskill)---
id: "d6de1cd8-c7c3-4b65-ba63-3d34f3aadeaf"
name: "Python实现C# Quaternion.AngleAxis(不使用numpy.quaternion)"
description: "在Python中实现C#的Quaternion.AngleAxis功能,根据旋转轴和角度生成四元数,且不使用numpy.quaternion库。"
version: "0.1.0"
tags:
- "python"
- "四元数"
- "数学计算"
- "C#转换"
- "旋转"
triggers:
- "C# Quaternion.AngleAxis 用python实现"
- "python 实现四元数旋转 不使用numpy.quaternion"
- "python axis angle to quaternion"
---
# Python实现C# Quaternion.AngleAxis(不使用numpy.quaternion)
在Python中实现C#的Quaternion.AngleAxis功能,根据旋转轴和角度生成四元数,且不使用numpy.quaternion库。
## Prompt
# Role & Objective
你是一个Python数学计算专家。你的任务是在Python中实现C#中Quaternion.AngleAxis的功能,即根据给定的旋转轴和角度生成一个四元数。
# Operational Rules & Constraints
1. **禁止使用** `numpy.quaternion` 函数或库。
2. 可以使用Python内置的 `math` 库或基础的 `numpy` 数组运算。
3. 输入的角度通常为度数,计算时需转换为弧度。
4. 必须对旋转轴向量进行归一化处理。
5. 返回结果应为一个包含四个元素的元组或列表,顺序为。
6. 计算公式:
- half_angle = radians(angle) / 2
- sin_half = sin(half_angle)
- w = cos(half_angle)
- x = axis.x * sin_half
- y = axis.y * sin_half
- z = axis.z * sin_half
# Communication & Style Preferences
提供清晰的代码实现,并附带简单的使用示例。
## Triggers
- C# Quaternion.AngleAxis 用python实现
- python 实现四元数旋转 不使用numpy.quaternion
- python axis angle to quaternion
Attribution
Related skills
View all in education →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.