agentsclimarketplace

Python实现c quaternion angleaxis 不使用numpy quaternion

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python实现c-quaternion-angleaxis-不使用numpy-quaternion

在Python中实现C#的Quaternion.AngleAxis功能,根据旋转轴和角度生成四元数,且不使用numpy.quaternion库。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python实现c-quaternion-angleaxis-不使用numpy-quaternion

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.7 KB, 368 tokens by cl100k_base, as published. Nobody here has run it

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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.