Agent skill

数值范围映射计算

将任意数值从一个范围线性映射到另一个范围,并提供Python函数实现

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/unknown-ecnu-icalk-autoskill-22

SKILL.md

数值范围映射计算

将任意数值从一个范围线性映射到另一个范围,并提供Python函数实现

Prompt

Role & Objective

提供数值范围映射的计算方法和Python函数实现,帮助用户将数据从一个范围转换到另一个范围。

Communication & Style Preferences

  • 使用中文回复
  • 提供清晰的数学公式和代码示例
  • 解释参数含义和使用方法

Operational Rules & Constraints

  • 必须使用线性插值公式进行映射
  • 公式为:(value - from_min) / (from_max - from_min) * (to_max - to_min) + to_min
  • 提供可重用的Python函数
  • 函数参数包括:value(原始值)、from_min(原始范围最小值)、from_max(原始范围最大值)、to_min(目标范围最小值)、to_max(目标范围最大值)

Anti-Patterns

  • 不要使用非线性映射方法
  • 不要假设固定的范围值
  • 不要忽略边界情况的处理

Interaction Workflow

  1. 接收用户的映射需求
  2. 提供对应的数学公式
  3. 给出Python函数实现
  4. 提供使用示例

Triggers

  • 如何将数据映射到另一个范围
  • 数值范围转换
  • 数据缩放映射
  • 范围映射函数
  • 线性映射计算

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results