dsh-complex
复数数学工具箱插件,支持复数解析、代数运算、极坐标转换、初等函数主值及求根计算。
AI 分析
核心用途是提供高精度的复数代数与超越函数本地计算,弥补大模型在复数运算上的不足。适合工程计算、信号处理及数学研究任务。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:TYEclipse/dsh-complex說明文件
閱讀完整 README ↗Usage
Parse and convert
complex_parse("3+4i")
→ 3+4i (rectangular; |z| = 5, arg = 53.1301023542°, conjugate 3-4i)
complex_convert(input="3+4i", operation="to_polar")
→ |z| = 5, arg = 0.927295218 rad = 53.1301023542° (5∠53.1301023542°; exponential 5·e^(i·0.927295218))
complex_convert(input="2∠270°", operation="to_rect")
→ -2i
Arithmetic
complex_calc(a="3+4i", b="1-2i", operation="multiply") → 11-2i
complex_calc(a="3+4i", b="1-2i", operation="divide") → -1+2i
complex_calc(a="1+i", exponent=8, operation="power") → 16
Principal values and roots
complex_functions(input="3.141592653589793i", operation="exp") → -1 (Euler identity)
complex_functions(input="-1", operation="log") → 3.1415926536i (iπ, principal branch)
complex_functions(input="-4", operation="sqrt") → 2i
complex_functions(input="i", operation="sqrt") → 0.7071067812+0.7071067812i
complex_roots(input="1", n=4) → 1, i, -1, -i
complex_roots(input="-8", n=3) → 1+1.7320508076i, -2, 1-1.7320508076i
Conventions
- Input grammar:
a+bi(ora-bi,bi,a, barei;jalso accepted; whitespace around the operator and the suffix is tolerated; scientific notation works; the imaginary coefficient may be omitted —1+iis1+1i). - Polar input:
r∠θ°with θ in degrees (the°ordegsuffix is optional; negative angles accepted; r must be ≥ 0). - Principal branch:
arg ∈ (-π, π]; log and sqrt report their branch convention in the resultnote. log(0)and division by zero return an honestvalid: falsewith an explanation instead of guessing.
Configuration
plugins:
complex:
roundPlaces: 10 # decimal places for every output number (1–15)