Files
DronePlanning/backend_service/venv/lib/python3.13/site-packages/mpmath/functions/signals.py
huangfu c4f851d387 chore: 添加虚拟环境到仓库
- 添加 backend_service/venv 虚拟环境
- 包含所有Python依赖包
- 注意:虚拟环境约393MB,包含12655个文件
2025-12-03 10:19:25 +08:00

33 lines
703 B
Python

from .functions import defun_wrapped
@defun_wrapped
def squarew(ctx, t, amplitude=1, period=1):
P = period
A = amplitude
return A*((-1)**ctx.floor(2*t/P))
@defun_wrapped
def trianglew(ctx, t, amplitude=1, period=1):
A = amplitude
P = period
return 2*A*(0.5 - ctx.fabs(1 - 2*ctx.frac(t/P + 0.25)))
@defun_wrapped
def sawtoothw(ctx, t, amplitude=1, period=1):
A = amplitude
P = period
return A*ctx.frac(t/P)
@defun_wrapped
def unit_triangle(ctx, t, amplitude=1):
A = amplitude
if t <= -1 or t >= 1:
return ctx.zero
return A*(-ctx.fabs(t) + 1)
@defun_wrapped
def sigmoid(ctx, t, amplitude=1):
A = amplitude
return A / (1 + ctx.exp(-t))