diff --git a/404.html b/404.html index b3be285..5a069bf 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@
- + \ No newline at end of file diff --git a/api-ex.html b/api-ex.html index b324d9f..6bce728 100644 --- a/api-ex.html +++ b/api-ex.html @@ -453,7 +453,7 @@ }

Page Frontmatter

{
   "outline": "deep"
 }

More

Check out the documentation for the full list of runtime APIs.

- + \ No newline at end of file diff --git a/api/index.html b/api/index.html index 053c8cd..07b4f1e 100644 --- a/api/index.html +++ b/api/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/api/mp_math/angle.html b/api/mp_math/angle.html index c00fd01..7b7e0ae 100644 --- a/api/mp_math/angle.html +++ b/api/mp_math/angle.html @@ -116,7 +116,7 @@ if isinstance(other, AnyAngle): return self.radian / other.radian return AnyAngle(self.radian / other, is_radian=True) - + \ No newline at end of file diff --git a/api/mp_math/const.html b/api/mp_math/const.html index 395f005..3f30277 100644 --- a/api/mp_math/const.html +++ b/api/mp_math/const.html @@ -18,7 +18,7 @@
Skip to content

var EPSILON = 0.0001

  • 说明: ε

var APPROX = 0.001

  • 说明: 约等于误差
- + \ No newline at end of file diff --git a/api/mp_math/equation.html b/api/mp_math/equation.html index 507a126..77111b9 100644 --- a/api/mp_math/equation.html +++ b/api/mp_math/equation.html @@ -12,16 +12,16 @@ - + -
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

说明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

参数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+    
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

说明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

参数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -59,7 +59,22 @@
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

说明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

参数:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

源代码
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -69,7 +84,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:
源代码
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:
源代码
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -82,7 +97,7 @@
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
         return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
- + \ No newline at end of file diff --git a/api/mp_math/index.html b/api/mp_math/index.html index 2d9f267..986ae15 100644 --- a/api/mp_math/index.html +++ b/api/mp_math/index.html @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/api/mp_math/line.html b/api/mp_math/line.html index 6aff5e7..edba496 100644 --- a/api/mp_math/line.html +++ b/api/mp_math/line.html @@ -195,7 +195,7 @@ """ return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
- + \ No newline at end of file diff --git a/api/mp_math/mp_math_typing.html b/api/mp_math/mp_math_typing.html index fc7b0f3..8d8df4d 100644 --- a/api/mp_math/mp_math_typing.html +++ b/api/mp_math/mp_math_typing.html @@ -18,7 +18,7 @@
Skip to content

var RealNumber = int | float

  • 类型: TypeAlias

  • 说明: 实数

var Number = RealNumber | complex

  • 类型: TypeAlias

  • 说明: 数

var SingleVar = TypeVar('SingleVar', bound=Number)

  • 说明: 单变量

var ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])

  • 说明: 数组变量

var Var = SingleVar | ArrayVar

  • 类型: TypeAlias

  • 说明: 变量

var OneSingleVarFunc = Callable[[SingleVar], SingleVar]

  • 类型: TypeAlias

  • 说明: 一元单变量函数

var OneArrayFunc = Callable[[ArrayVar], ArrayVar]

  • 类型: TypeAlias

  • 说明: 一元数组函数

var OneVarFunc = OneSingleVarFunc | OneArrayFunc

  • 类型: TypeAlias

  • 说明: 一元函数

var TwoSingleVarsFunc = Callable[[SingleVar, SingleVar], SingleVar]

  • 类型: TypeAlias

  • 说明: 二元单变量函数

var TwoArraysFunc = Callable[[ArrayVar, ArrayVar], ArrayVar]

  • 类型: TypeAlias

  • 说明: 二元数组函数

var TwoVarsFunc = TwoSingleVarsFunc | TwoArraysFunc

  • 类型: TypeAlias

  • 说明: 二元函数

var ThreeSingleVarsFunc = Callable[[SingleVar, SingleVar, SingleVar], SingleVar]

  • 类型: TypeAlias

  • 说明: 三元单变量函数

var ThreeArraysFunc = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar]

  • 类型: TypeAlias

  • 说明: 三元数组函数

var ThreeVarsFunc = ThreeSingleVarsFunc | ThreeArraysFunc

  • 类型: TypeAlias

  • 说明: 三元函数

var MultiSingleVarsFunc = Callable[..., SingleVar]

  • 类型: TypeAlias

  • 说明: 多元单变量函数

var MultiArraysFunc = Callable[..., ArrayVar]

  • 类型: TypeAlias

  • 说明: 多元数组函数

var MultiVarsFunc = MultiSingleVarsFunc | MultiArraysFunc

  • 类型: TypeAlias

  • 说明: 多元函数

- + \ No newline at end of file diff --git a/api/mp_math/plane.html b/api/mp_math/plane.html index c78966c..03ec60a 100644 --- a/api/mp_math/plane.html +++ b/api/mp_math/plane.html @@ -213,7 +213,7 @@ raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

method __eq__(self, other) -> bool

源代码
python
def __eq__(self, other) -> bool:
     return self.approx(other)

method __rand__(self, other: Line3) -> Point3

源代码
python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)
- + \ No newline at end of file diff --git a/api/mp_math/point.html b/api/mp_math/point.html index 2d71357..e3670f1 100644 --- a/api/mp_math/point.html +++ b/api/mp_math/point.html @@ -68,7 +68,7 @@ """ from .vector import Vector3 return Vector3(self.x - other.x, self.y - other.y, self.z - other.z) - + \ No newline at end of file diff --git a/api/mp_math/segment.html b/api/mp_math/segment.html index 86e27bb..48e9ff6 100644 --- a/api/mp_math/segment.html +++ b/api/mp_math/segment.html @@ -31,7 +31,7 @@ self.length = self.direction.length '中心点' self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2) - + \ No newline at end of file diff --git a/api/mp_math/utils.html b/api/mp_math/utils.html index 98971b7..b07fc43 100644 --- a/api/mp_math/utils.html +++ b/api/mp_math/utils.html @@ -81,7 +81,7 @@ self.raise_type_error(other)

method raise_type_error(self, other)

源代码
python
def raise_type_error(self, other):
     raise TypeError(f'Unsupported type: {type(self.value)} and {type(other)}')

method __ne__(self, other)

源代码
python
def __ne__(self, other):
     return not self.__eq__(other)
- + \ No newline at end of file diff --git a/api/mp_math/vector.html b/api/mp_math/vector.html index 48892f6..8733e9a 100644 --- a/api/mp_math/vector.html +++ b/api/mp_math/vector.html @@ -204,7 +204,7 @@ return self.x * other.x + self.y * other.y + self.z * other.z

method self / other: RealNumber => Vector3

源代码
python
def __truediv__(self, other: RealNumber) -> 'Vector3':
     return Vector3(self.x / other, self.y / other, self.z / other)

method - self

源代码
python
def __neg__(self):
     return Vector3(-self.x, -self.y, -self.z)

var zero_vector3 = Vector3(0, 0, 0)

var x_axis = Vector3(1, 0, 0)

var y_axis = Vector3(0, 1, 0)

var z_axis = Vector3(0, 0, 1)

- + \ No newline at end of file diff --git a/api/particle/index.html b/api/particle/index.html index d2e59e5..8e4fcf1 100644 --- a/api/particle/index.html +++ b/api/particle/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/api/presets/index.html b/api/presets/index.html index 9dd76bc..e39227f 100644 --- a/api/presets/index.html +++ b/api/presets/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/api/presets/model/index.html b/api/presets/model/index.html index cf38c7a..ad8d780 100644 --- a/api/presets/model/index.html +++ b/api/presets/model/index.html @@ -35,7 +35,7 @@ y_array = radius * np.sin(phi_list) * np.sin(theta_list) z_array = radius * np.cos(phi_list) return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)] - + \ No newline at end of file diff --git a/assets/ja_api_mp_math_equation.md.tmRhsqm6.js b/assets/api_mp_math_equation.md.D6QhNvHe.js similarity index 58% rename from assets/ja_api_mp_math_equation.md.tmRhsqm6.js rename to assets/api_mp_math_equation.md.D6QhNvHe.js index db4cd31..0f71f02 100644 --- a/assets/ja_api_mp_math_equation.md.tmRhsqm6.js +++ b/assets/api_mp_math_equation.md.D6QhNvHe.js @@ -1,8 +1,8 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),l={name:"ja/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

引数:

戻り値: 偏导函数

例外:

ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

说明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

参数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -40,7 +40,22 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

说明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

参数:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

源代码
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -50,7 +65,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:
ソースコード
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:
源代码
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -62,4 +77,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
     if len(t) == 1:
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
-        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; + return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/assets/api_mp_math_equation.md.Cug6-NqN.lean.js b/assets/api_mp_math_equation.md.D6QhNvHe.lean.js similarity index 57% rename from assets/api_mp_math_equation.md.Cug6-NqN.lean.js rename to assets/api_mp_math_equation.md.D6QhNvHe.lean.js index f4480bb..4c1801f 100644 --- a/assets/api_mp_math_equation.md.Cug6-NqN.lean.js +++ b/assets/api_mp_math_equation.md.D6QhNvHe.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n("",20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n("",27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/assets/en_api_mp_math_equation.md.YQDGr03a.js b/assets/en_api_mp_math_equation.md.CdqZIJEO.js similarity index 61% rename from assets/en_api_mp_math_equation.md.YQDGr03a.js rename to assets/en_api_mp_math_equation.md.CdqZIJEO.js index 6d6c7b2..14f4347 100644 --- a/assets/en_api_mp_math_equation.md.YQDGr03a.js +++ b/assets/en_api_mp_math_equation.md.CdqZIJEO.js @@ -1,8 +1,8 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),l={name:"en/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

Description: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

Arguments:

Return: 偏导函数

Raises:

Source code
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),l={name:"en/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

Description: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

Arguments:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

Return: 偏导函数

Raises:

  • ValueError 无效变量类型
Source code
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -40,7 +40,22 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

Description: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

Arguments:

  • func: 函数
  • *args: 参数

Return: 柯里化后的函数

Source code
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -50,7 +65,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:
Source code
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:
Source code
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -62,4 +77,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u
     if len(t) == 1:
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
-        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; + return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,27),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(l,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/en_api_mp_math_equation.md.YQDGr03a.lean.js b/assets/en_api_mp_math_equation.md.CdqZIJEO.lean.js similarity index 72% rename from assets/en_api_mp_math_equation.md.YQDGr03a.lean.js rename to assets/en_api_mp_math_equation.md.CdqZIJEO.lean.js index b8aa112..b032078 100644 --- a/assets/en_api_mp_math_equation.md.YQDGr03a.lean.js +++ b/assets/en_api_mp_math_equation.md.CdqZIJEO.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),l={name:"en/api/mp_math/equation.md"},t=n("",20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),l={name:"en/api/mp_math/equation.md"},t=n("",27),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(l,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/api_mp_math_equation.md.Cug6-NqN.js b/assets/ja_api_mp_math_equation.md.B2lD-VSI.js similarity index 63% rename from assets/api_mp_math_equation.md.Cug6-NqN.js rename to assets/ja_api_mp_math_equation.md.B2lD-VSI.js index f510992..243622f 100644 --- a/assets/api_mp_math_equation.md.Cug6-NqN.js +++ b/assets/ja_api_mp_math_equation.md.B2lD-VSI.js @@ -1,8 +1,8 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

说明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

参数:

返回: 偏导函数

引发:

源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),l={name:"ja/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

引数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -40,7 +40,22 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

説明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

引数:

  • func: 函数
  • *args: 参数

戻り値: 柯里化后的函数

ソースコード
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -50,7 +65,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:
源代码
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:
ソースコード
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -62,4 +77,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
     if len(t) == 1:
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
-        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; + return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_equation.md.tmRhsqm6.lean.js b/assets/ja_api_mp_math_equation.md.B2lD-VSI.lean.js similarity index 55% rename from assets/ja_api_mp_math_equation.md.tmRhsqm6.lean.js rename to assets/ja_api_mp_math_equation.md.B2lD-VSI.lean.js index 4ded0f5..4d288f6 100644 --- a/assets/ja_api_mp_math_equation.md.tmRhsqm6.lean.js +++ b/assets/ja_api_mp_math_equation.md.B2lD-VSI.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),l={name:"ja/api/mp_math/equation.md"},t=n("",20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),l={name:"ja/api/mp_math/equation.md"},t=n("",27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_equation.md.5p50czv3.js b/assets/zht_api_mp_math_equation.md.H6Y480q1.js similarity index 61% rename from assets/zht_api_mp_math_equation.md.5p50czv3.js rename to assets/zht_api_mp_math_equation.md.H6Y480q1.js index 085f9de..65257a2 100644 --- a/assets/zht_api_mp_math_equation.md.5p50czv3.js +++ b/assets/zht_api_mp_math_equation.md.H6Y480q1.js @@ -1,8 +1,8 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),l={name:"zht/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

變數説明:

返回: 偏导函数

抛出:

源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),l={name:"zht/api/mp_math/equation.md"},t=n(`

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

變數説明:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -40,7 +40,22 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

説明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

變數説明:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

源碼
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -50,7 +65,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:
源碼
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:
源碼
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -62,4 +77,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F
     if len(t) == 1:
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
-        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; + return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
`,27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_equation.md.5p50czv3.lean.js b/assets/zht_api_mp_math_equation.md.H6Y480q1.lean.js similarity index 54% rename from assets/zht_api_mp_math_equation.md.5p50czv3.lean.js rename to assets/zht_api_mp_math_equation.md.H6Y480q1.lean.js index 3a53c98..485bad1 100644 --- a/assets/zht_api_mp_math_equation.md.5p50czv3.lean.js +++ b/assets/zht_api_mp_math_equation.md.H6Y480q1.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),l={name:"zht/api/mp_math/equation.md"},t=n("",20),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const u=s(l,[["render",p]]);export{F as __pageData,u as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation"},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),l={name:"zht/api/mp_math/equation.md"},t=n("",27),h=[t];function p(k,e,r,E,d,g){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{u as __pageData,F as default}; diff --git a/en/api/index.html b/en/api/index.html index d23e7d9..9203960 100644 --- a/en/api/index.html +++ b/en/api/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/en/api/mp_math/angle.html b/en/api/mp_math/angle.html index aac9a9b..de106f8 100644 --- a/en/api/mp_math/angle.html +++ b/en/api/mp_math/angle.html @@ -116,7 +116,7 @@ if isinstance(other, AnyAngle): return self.radian / other.radian return AnyAngle(self.radian / other, is_radian=True) - + \ No newline at end of file diff --git a/en/api/mp_math/const.html b/en/api/mp_math/const.html index 7e53814..4b51c5e 100644 --- a/en/api/mp_math/const.html +++ b/en/api/mp_math/const.html @@ -18,7 +18,7 @@
Skip to content

var EPSILON = 0.0001

  • Description: ε

var APPROX = 0.001

  • Description: 约等于误差
- + \ No newline at end of file diff --git a/en/api/mp_math/equation.html b/en/api/mp_math/equation.html index ab1c6a8..2709653 100644 --- a/en/api/mp_math/equation.html +++ b/en/api/mp_math/equation.html @@ -12,16 +12,16 @@ - + -
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

Description: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

Arguments:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

Return: 偏导函数

Raises:

  • ValueError 无效变量类型
Source code
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+    
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

Description: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

Arguments:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

Return: 偏导函数

Raises:

  • ValueError 无效变量类型
Source code
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -59,7 +59,22 @@
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

Description: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

Arguments:

  • func: 函数
  • *args: 参数

Return: 柯里化后的函数

Source code
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -69,7 +84,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:
Source code
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:
Source code
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -82,7 +97,7 @@
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
         return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
- + \ No newline at end of file diff --git a/en/api/mp_math/index.html b/en/api/mp_math/index.html index 18744e4..a9f2696 100644 --- a/en/api/mp_math/index.html +++ b/en/api/mp_math/index.html @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/en/api/mp_math/line.html b/en/api/mp_math/line.html index c170f70..c621dd1 100644 --- a/en/api/mp_math/line.html +++ b/en/api/mp_math/line.html @@ -195,7 +195,7 @@ """ return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
- + \ No newline at end of file diff --git a/en/api/mp_math/mp_math_typing.html b/en/api/mp_math/mp_math_typing.html index 65f0b38..d264080 100644 --- a/en/api/mp_math/mp_math_typing.html +++ b/en/api/mp_math/mp_math_typing.html @@ -18,7 +18,7 @@
Skip to content

var RealNumber = int | float

  • Type: TypeAlias

  • Description: 实数

var Number = RealNumber | complex

  • Type: TypeAlias

  • Description: 数

var SingleVar = TypeVar('SingleVar', bound=Number)

  • Description: 单变量

var ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])

  • Description: 数组变量

var Var = SingleVar | ArrayVar

  • Type: TypeAlias

  • Description: 变量

var OneSingleVarFunc = Callable[[SingleVar], SingleVar]

  • Type: TypeAlias

  • Description: 一元单变量函数

var OneArrayFunc = Callable[[ArrayVar], ArrayVar]

  • Type: TypeAlias

  • Description: 一元数组函数

var OneVarFunc = OneSingleVarFunc | OneArrayFunc

  • Type: TypeAlias

  • Description: 一元函数

var TwoSingleVarsFunc = Callable[[SingleVar, SingleVar], SingleVar]

  • Type: TypeAlias

  • Description: 二元单变量函数

var TwoArraysFunc = Callable[[ArrayVar, ArrayVar], ArrayVar]

  • Type: TypeAlias

  • Description: 二元数组函数

var TwoVarsFunc = TwoSingleVarsFunc | TwoArraysFunc

  • Type: TypeAlias

  • Description: 二元函数

var ThreeSingleVarsFunc = Callable[[SingleVar, SingleVar, SingleVar], SingleVar]

  • Type: TypeAlias

  • Description: 三元单变量函数

var ThreeArraysFunc = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar]

  • Type: TypeAlias

  • Description: 三元数组函数

var ThreeVarsFunc = ThreeSingleVarsFunc | ThreeArraysFunc

  • Type: TypeAlias

  • Description: 三元函数

var MultiSingleVarsFunc = Callable[..., SingleVar]

  • Type: TypeAlias

  • Description: 多元单变量函数

var MultiArraysFunc = Callable[..., ArrayVar]

  • Type: TypeAlias

  • Description: 多元数组函数

var MultiVarsFunc = MultiSingleVarsFunc | MultiArraysFunc

  • Type: TypeAlias

  • Description: 多元函数

- + \ No newline at end of file diff --git a/en/api/mp_math/plane.html b/en/api/mp_math/plane.html index 8a0487b..9560d70 100644 --- a/en/api/mp_math/plane.html +++ b/en/api/mp_math/plane.html @@ -213,7 +213,7 @@ raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

method __eq__(self, other) -> bool

Source code
python
def __eq__(self, other) -> bool:
     return self.approx(other)

method __rand__(self, other: Line3) -> Point3

Source code
python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)
- + \ No newline at end of file diff --git a/en/api/mp_math/point.html b/en/api/mp_math/point.html index 41cf088..38ca673 100644 --- a/en/api/mp_math/point.html +++ b/en/api/mp_math/point.html @@ -68,7 +68,7 @@ """ from .vector import Vector3 return Vector3(self.x - other.x, self.y - other.y, self.z - other.z) - + \ No newline at end of file diff --git a/en/api/mp_math/segment.html b/en/api/mp_math/segment.html index 8b069d9..0e0360c 100644 --- a/en/api/mp_math/segment.html +++ b/en/api/mp_math/segment.html @@ -31,7 +31,7 @@ self.length = self.direction.length '中心点' self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2) - + \ No newline at end of file diff --git a/en/api/mp_math/utils.html b/en/api/mp_math/utils.html index 44850e5..7df04a3 100644 --- a/en/api/mp_math/utils.html +++ b/en/api/mp_math/utils.html @@ -81,7 +81,7 @@ self.raise_type_error(other)

method raise_type_error(self, other)

Source code
python
def raise_type_error(self, other):
     raise TypeError(f'Unsupported type: {type(self.value)} and {type(other)}')

method __ne__(self, other)

Source code
python
def __ne__(self, other):
     return not self.__eq__(other)
- + \ No newline at end of file diff --git a/en/api/mp_math/vector.html b/en/api/mp_math/vector.html index e942af2..9601e75 100644 --- a/en/api/mp_math/vector.html +++ b/en/api/mp_math/vector.html @@ -204,7 +204,7 @@ return self.x * other.x + self.y * other.y + self.z * other.z

method self / other: RealNumber => Vector3

Source code
python
def __truediv__(self, other: RealNumber) -> 'Vector3':
     return Vector3(self.x / other, self.y / other, self.z / other)

method - self

Source code
python
def __neg__(self):
     return Vector3(-self.x, -self.y, -self.z)

var zero_vector3 = Vector3(0, 0, 0)

var x_axis = Vector3(1, 0, 0)

var y_axis = Vector3(0, 1, 0)

var z_axis = Vector3(0, 0, 1)

- + \ No newline at end of file diff --git a/en/api/particle/index.html b/en/api/particle/index.html index 89d3a71..6e4b5a3 100644 --- a/en/api/particle/index.html +++ b/en/api/particle/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/en/api/presets/index.html b/en/api/presets/index.html index 26c4680..56edf4a 100644 --- a/en/api/presets/index.html +++ b/en/api/presets/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/en/api/presets/model/index.html b/en/api/presets/model/index.html index e2b2ef9..e70b849 100644 --- a/en/api/presets/model/index.html +++ b/en/api/presets/model/index.html @@ -35,7 +35,7 @@ y_array = radius * np.sin(phi_list) * np.sin(theta_list) z_array = radius * np.cos(phi_list) return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)] - + \ No newline at end of file diff --git a/guide/index.html b/guide/index.html index 35c6c69..5b5b183 100644 --- a/guide/index.html +++ b/guide/index.html @@ -18,7 +18,7 @@
Skip to content

开始不了一点

- + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index aabbd0a..59bea36 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"api-ex.md":"DOsKaL8H","api_index.md":"BvazTqTB","api_mp_math_angle.md":"eAy7w1HN","api_mp_math_const.md":"D9zs7__H","api_mp_math_equation.md":"Cug6-NqN","api_mp_math_index.md":"4P0hk6gb","api_mp_math_line.md":"DsJQDchM","api_mp_math_mp_math_typing.md":"COrE_fd3","api_mp_math_plane.md":"CmoVvPiw","api_mp_math_point.md":"ClJD85mP","api_mp_math_segment.md":"7jBtS4F1","api_mp_math_utils.md":"BMwtm7TJ","api_mp_math_vector.md":"CROCIDXX","api_particle_index.md":"BRCSxC3e","api_presets_index.md":"Dl6Ss91J","api_presets_model_index.md":"DUZx13AW","en_api_index.md":"Bgu-LD1B","en_api_mp_math_angle.md":"BuhpKHnt","en_api_mp_math_const.md":"D_Flpj8t","en_api_mp_math_equation.md":"YQDGr03a","en_api_mp_math_index.md":"DrjDUYBY","en_api_mp_math_line.md":"BEvxdWYQ","en_api_mp_math_mp_math_typing.md":"CyXXFdS4","en_api_mp_math_plane.md":"DUu9P3nM","en_api_mp_math_point.md":"DMig0FI1","en_api_mp_math_segment.md":"CcaokAF8","en_api_mp_math_utils.md":"DZohqw2b","en_api_mp_math_vector.md":"Sd_IZsgE","en_api_particle_index.md":"CmC1QX5o","en_api_presets_index.md":"CZ5hl_7D","en_api_presets_model_index.md":"Cs8vON2C","guide_index.md":"BE2yloik","index.md":"BE1qChTt","ja_api_index.md":"4BnflFIm","ja_api_mp_math_angle.md":"DL9J6RE2","ja_api_mp_math_const.md":"CyaIJkFx","ja_api_mp_math_equation.md":"tmRhsqm6","ja_api_mp_math_index.md":"CSAMHYsB","ja_api_mp_math_line.md":"fj-_s5Ug","ja_api_mp_math_mp_math_typing.md":"Bl5kyhpI","ja_api_mp_math_plane.md":"yLekgCvK","ja_api_mp_math_point.md":"CpHHrSk8","ja_api_mp_math_segment.md":"CB1_z-rn","ja_api_mp_math_utils.md":"BrfEEfl-","ja_api_mp_math_vector.md":"p54TKACE","ja_api_particle_index.md":"E2YnH7EN","ja_api_presets_index.md":"ATGcHt9d","ja_api_presets_model_index.md":"D8yZmO5R","md-ex.md":"BX0WqOqv","zht_api_index.md":"Dq4XPUKZ","zht_api_mp_math_angle.md":"B4T6L25M","zht_api_mp_math_const.md":"B8uQOIr_","zht_api_mp_math_equation.md":"5p50czv3","zht_api_mp_math_index.md":"D09y2ubg","zht_api_mp_math_line.md":"DYC1X0oD","zht_api_mp_math_mp_math_typing.md":"DLx0IibM","zht_api_mp_math_plane.md":"B6GWRRF6","zht_api_mp_math_point.md":"Bm1IEwlI","zht_api_mp_math_segment.md":"Bop8t2IE","zht_api_mp_math_utils.md":"CERv8c-M","zht_api_mp_math_vector.md":"BTWxlpB1","zht_api_particle_index.md":"kAm9VAEw","zht_api_presets_index.md":"BmouaEaT","zht_api_presets_model_index.md":"SQ5PPdaL"} +{"api-ex.md":"DOsKaL8H","api_index.md":"BvazTqTB","api_mp_math_angle.md":"eAy7w1HN","api_mp_math_const.md":"D9zs7__H","api_mp_math_equation.md":"D6QhNvHe","api_mp_math_index.md":"4P0hk6gb","api_mp_math_line.md":"DsJQDchM","api_mp_math_mp_math_typing.md":"COrE_fd3","api_mp_math_plane.md":"CmoVvPiw","api_mp_math_point.md":"ClJD85mP","api_mp_math_segment.md":"7jBtS4F1","api_mp_math_utils.md":"BMwtm7TJ","api_mp_math_vector.md":"CROCIDXX","api_particle_index.md":"BRCSxC3e","api_presets_index.md":"Dl6Ss91J","api_presets_model_index.md":"DUZx13AW","en_api_index.md":"Bgu-LD1B","en_api_mp_math_angle.md":"BuhpKHnt","en_api_mp_math_const.md":"D_Flpj8t","en_api_mp_math_equation.md":"CdqZIJEO","en_api_mp_math_index.md":"DrjDUYBY","en_api_mp_math_line.md":"BEvxdWYQ","en_api_mp_math_mp_math_typing.md":"CyXXFdS4","en_api_mp_math_plane.md":"DUu9P3nM","en_api_mp_math_point.md":"DMig0FI1","en_api_mp_math_segment.md":"CcaokAF8","en_api_mp_math_utils.md":"DZohqw2b","en_api_mp_math_vector.md":"Sd_IZsgE","en_api_particle_index.md":"CmC1QX5o","en_api_presets_index.md":"CZ5hl_7D","en_api_presets_model_index.md":"Cs8vON2C","guide_index.md":"BE2yloik","index.md":"BE1qChTt","ja_api_index.md":"4BnflFIm","ja_api_mp_math_angle.md":"DL9J6RE2","ja_api_mp_math_const.md":"CyaIJkFx","ja_api_mp_math_equation.md":"B2lD-VSI","ja_api_mp_math_index.md":"CSAMHYsB","ja_api_mp_math_line.md":"fj-_s5Ug","ja_api_mp_math_mp_math_typing.md":"Bl5kyhpI","ja_api_mp_math_plane.md":"yLekgCvK","ja_api_mp_math_point.md":"CpHHrSk8","ja_api_mp_math_segment.md":"CB1_z-rn","ja_api_mp_math_utils.md":"BrfEEfl-","ja_api_mp_math_vector.md":"p54TKACE","ja_api_particle_index.md":"E2YnH7EN","ja_api_presets_index.md":"ATGcHt9d","ja_api_presets_model_index.md":"D8yZmO5R","md-ex.md":"BX0WqOqv","zht_api_index.md":"Dq4XPUKZ","zht_api_mp_math_angle.md":"B4T6L25M","zht_api_mp_math_const.md":"B8uQOIr_","zht_api_mp_math_equation.md":"H6Y480q1","zht_api_mp_math_index.md":"D09y2ubg","zht_api_mp_math_line.md":"DYC1X0oD","zht_api_mp_math_mp_math_typing.md":"DLx0IibM","zht_api_mp_math_plane.md":"B6GWRRF6","zht_api_mp_math_point.md":"Bm1IEwlI","zht_api_mp_math_segment.md":"Bop8t2IE","zht_api_mp_math_utils.md":"CERv8c-M","zht_api_mp_math_vector.md":"BTWxlpB1","zht_api_particle_index.md":"kAm9VAEw","zht_api_presets_index.md":"BmouaEaT","zht_api_presets_model_index.md":"SQ5PPdaL"} diff --git a/index.html b/index.html index ef91fca..a782838 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@
Skip to content

MBCP docs

More basic change particle

用于几何运算和粒子制作的库

- + \ No newline at end of file diff --git a/ja/api/index.html b/ja/api/index.html index a31ce57..91c8f08 100644 --- a/ja/api/index.html +++ b/ja/api/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/ja/api/mp_math/angle.html b/ja/api/mp_math/angle.html index a6529a0..3a55bb1 100644 --- a/ja/api/mp_math/angle.html +++ b/ja/api/mp_math/angle.html @@ -116,7 +116,7 @@ if isinstance(other, AnyAngle): return self.radian / other.radian return AnyAngle(self.radian / other, is_radian=True) - + \ No newline at end of file diff --git a/ja/api/mp_math/const.html b/ja/api/mp_math/const.html index ff1573e..f1adc88 100644 --- a/ja/api/mp_math/const.html +++ b/ja/api/mp_math/const.html @@ -18,7 +18,7 @@
Skip to content

var EPSILON = 0.0001

  • 説明: ε

var APPROX = 0.001

  • 説明: 约等于误差
- + \ No newline at end of file diff --git a/ja/api/mp_math/equation.html b/ja/api/mp_math/equation.html index c68af43..7089624 100644 --- a/ja/api/mp_math/equation.html +++ b/ja/api/mp_math/equation.html @@ -12,16 +12,16 @@ - + -
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

引数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+    
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

引数:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -59,7 +59,22 @@
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

説明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

引数:

  • func: 函数
  • *args: 参数

戻り値: 柯里化后的函数

ソースコード
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -69,7 +84,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:
ソースコード
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:
ソースコード
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -82,7 +97,7 @@
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
         return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
- + \ No newline at end of file diff --git a/ja/api/mp_math/index.html b/ja/api/mp_math/index.html index 73edead..f20c69e 100644 --- a/ja/api/mp_math/index.html +++ b/ja/api/mp_math/index.html @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/ja/api/mp_math/line.html b/ja/api/mp_math/line.html index 055eaa7..0feee8b 100644 --- a/ja/api/mp_math/line.html +++ b/ja/api/mp_math/line.html @@ -195,7 +195,7 @@ """ return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
- + \ No newline at end of file diff --git a/ja/api/mp_math/mp_math_typing.html b/ja/api/mp_math/mp_math_typing.html index f3661f0..b9fcaef 100644 --- a/ja/api/mp_math/mp_math_typing.html +++ b/ja/api/mp_math/mp_math_typing.html @@ -18,7 +18,7 @@
Skip to content

var RealNumber = int | float

  • タイプ: TypeAlias

  • 説明: 实数

var Number = RealNumber | complex

  • タイプ: TypeAlias

  • 説明: 数

var SingleVar = TypeVar('SingleVar', bound=Number)

  • 説明: 单变量

var ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])

  • 説明: 数组变量

var Var = SingleVar | ArrayVar

  • タイプ: TypeAlias

  • 説明: 变量

var OneSingleVarFunc = Callable[[SingleVar], SingleVar]

  • タイプ: TypeAlias

  • 説明: 一元单变量函数

var OneArrayFunc = Callable[[ArrayVar], ArrayVar]

  • タイプ: TypeAlias

  • 説明: 一元数组函数

var OneVarFunc = OneSingleVarFunc | OneArrayFunc

  • タイプ: TypeAlias

  • 説明: 一元函数

var TwoSingleVarsFunc = Callable[[SingleVar, SingleVar], SingleVar]

  • タイプ: TypeAlias

  • 説明: 二元单变量函数

var TwoArraysFunc = Callable[[ArrayVar, ArrayVar], ArrayVar]

  • タイプ: TypeAlias

  • 説明: 二元数组函数

var TwoVarsFunc = TwoSingleVarsFunc | TwoArraysFunc

  • タイプ: TypeAlias

  • 説明: 二元函数

var ThreeSingleVarsFunc = Callable[[SingleVar, SingleVar, SingleVar], SingleVar]

  • タイプ: TypeAlias

  • 説明: 三元单变量函数

var ThreeArraysFunc = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar]

  • タイプ: TypeAlias

  • 説明: 三元数组函数

var ThreeVarsFunc = ThreeSingleVarsFunc | ThreeArraysFunc

  • タイプ: TypeAlias

  • 説明: 三元函数

var MultiSingleVarsFunc = Callable[..., SingleVar]

  • タイプ: TypeAlias

  • 説明: 多元单变量函数

var MultiArraysFunc = Callable[..., ArrayVar]

  • タイプ: TypeAlias

  • 説明: 多元数组函数

var MultiVarsFunc = MultiSingleVarsFunc | MultiArraysFunc

  • タイプ: TypeAlias

  • 説明: 多元函数

- + \ No newline at end of file diff --git a/ja/api/mp_math/plane.html b/ja/api/mp_math/plane.html index 9e57b66..c28e233 100644 --- a/ja/api/mp_math/plane.html +++ b/ja/api/mp_math/plane.html @@ -213,7 +213,7 @@ raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

method __eq__(self, other) -> bool

ソースコード
python
def __eq__(self, other) -> bool:
     return self.approx(other)

method __rand__(self, other: Line3) -> Point3

ソースコード
python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)
- + \ No newline at end of file diff --git a/ja/api/mp_math/point.html b/ja/api/mp_math/point.html index a3126d1..9fc5f41 100644 --- a/ja/api/mp_math/point.html +++ b/ja/api/mp_math/point.html @@ -68,7 +68,7 @@ """ from .vector import Vector3 return Vector3(self.x - other.x, self.y - other.y, self.z - other.z) - + \ No newline at end of file diff --git a/ja/api/mp_math/segment.html b/ja/api/mp_math/segment.html index 79251f0..dbf4ebe 100644 --- a/ja/api/mp_math/segment.html +++ b/ja/api/mp_math/segment.html @@ -31,7 +31,7 @@ self.length = self.direction.length '中心点' self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2) - + \ No newline at end of file diff --git a/ja/api/mp_math/utils.html b/ja/api/mp_math/utils.html index 5916786..753a5c7 100644 --- a/ja/api/mp_math/utils.html +++ b/ja/api/mp_math/utils.html @@ -81,7 +81,7 @@ self.raise_type_error(other)

method raise_type_error(self, other)

ソースコード
python
def raise_type_error(self, other):
     raise TypeError(f'Unsupported type: {type(self.value)} and {type(other)}')

method __ne__(self, other)

ソースコード
python
def __ne__(self, other):
     return not self.__eq__(other)
- + \ No newline at end of file diff --git a/ja/api/mp_math/vector.html b/ja/api/mp_math/vector.html index 7e38615..ff0cdf1 100644 --- a/ja/api/mp_math/vector.html +++ b/ja/api/mp_math/vector.html @@ -204,7 +204,7 @@ return self.x * other.x + self.y * other.y + self.z * other.z

method self / other: RealNumber => Vector3

ソースコード
python
def __truediv__(self, other: RealNumber) -> 'Vector3':
     return Vector3(self.x / other, self.y / other, self.z / other)

method - self

ソースコード
python
def __neg__(self):
     return Vector3(-self.x, -self.y, -self.z)

var zero_vector3 = Vector3(0, 0, 0)

var x_axis = Vector3(1, 0, 0)

var y_axis = Vector3(0, 1, 0)

var z_axis = Vector3(0, 0, 1)

- + \ No newline at end of file diff --git a/ja/api/particle/index.html b/ja/api/particle/index.html index 7390b96..51f4dd2 100644 --- a/ja/api/particle/index.html +++ b/ja/api/particle/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/ja/api/presets/index.html b/ja/api/presets/index.html index c5e598a..2d22221 100644 --- a/ja/api/presets/index.html +++ b/ja/api/presets/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/ja/api/presets/model/index.html b/ja/api/presets/model/index.html index e86d806..b1b9b89 100644 --- a/ja/api/presets/model/index.html +++ b/ja/api/presets/model/index.html @@ -35,7 +35,7 @@ y_array = radius * np.sin(phi_list) * np.sin(theta_list) z_array = radius * np.cos(phi_list) return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)] - + \ No newline at end of file diff --git a/md-ex.html b/md-ex.html index 577f142..f8948be 100644 --- a/md-ex.html +++ b/md-ex.html @@ -50,7 +50,7 @@ ::: details This is a details block. :::

Output

INFO

This is an info box.

TIP

This is a tip.

WARNING

This is a warning.

DANGER

This is a dangerous warning.

Details

This is a details block.

More

Check out the documentation for the full list of markdown extensions.

- + \ No newline at end of file diff --git a/zht/api/index.html b/zht/api/index.html index 02b1c23..5b4943f 100644 --- a/zht/api/index.html +++ b/zht/api/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/zht/api/mp_math/angle.html b/zht/api/mp_math/angle.html index e6c28e9..30253d3 100644 --- a/zht/api/mp_math/angle.html +++ b/zht/api/mp_math/angle.html @@ -116,7 +116,7 @@ if isinstance(other, AnyAngle): return self.radian / other.radian return AnyAngle(self.radian / other, is_radian=True) - + \ No newline at end of file diff --git a/zht/api/mp_math/const.html b/zht/api/mp_math/const.html index eae6c25..4d8dabd 100644 --- a/zht/api/mp_math/const.html +++ b/zht/api/mp_math/const.html @@ -18,7 +18,7 @@
Skip to content

var EPSILON = 0.0001

  • 説明: ε

var APPROX = 0.001

  • 説明: 约等于误差
- + \ No newline at end of file diff --git a/zht/api/mp_math/equation.html b/zht/api/mp_math/equation.html index 0b2c29c..036eb84 100644 --- a/zht/api/mp_math/equation.html +++ b/zht/api/mp_math/equation.html @@ -12,16 +12,16 @@ - + -
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。

變數説明:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+    
Skip to content

func get_partial_derivative_func(func: MultiVarsFunc = EPSILON) -> MultiVarsFunc

説明: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。

WARNING

目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升

變數説明:

  • func: 函数
  • var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
  • epsilon: 偏移量

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
-    > 目前数学界对于数值微分的稳定性问题还没有很好的解决方案,因此这个函数的稳定性也不是很好。
+    > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升
 
     Args:
         func: 函数
@@ -59,7 +59,22 @@
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
+        raise ValueError('Invalid var type')

func curry(*args: Var) -> OneVarFunc

説明: 对多参数函数进行柯里化。

TIP

有关函数柯里化,可参考函数式编程--柯理化(Currying)

變數説明:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

源碼
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+    """
+    对多参数函数进行柯里化。
+    > [!tip]
+    > 有关函数柯里化,可参考[函数式编程--柯理化(Currying)](https://zhuanlan.zhihu.com/p/355859667)
+    Args:
+        func: 函数
+        *args: 参数
+    Returns:
+        柯里化后的函数
+    """
+
+    def curried_func(*args2: Var) -> Var:
+        """@litedoc-hide"""
+        return func(*args, *args2)
+    return curried_func

class CurveEquation

method __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼
python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -69,7 +84,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

method __call__(self) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:
源碼
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
+    self.z_func = z_func

method __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:
源碼
python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -82,7 +97,7 @@
         return Point3(self.x_func(t[0]), self.y_func(t[0]), self.z_func(t[0]))
     else:
         return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])
- + \ No newline at end of file diff --git a/zht/api/mp_math/index.html b/zht/api/mp_math/index.html index 73bb453..134f4b6 100644 --- a/zht/api/mp_math/index.html +++ b/zht/api/mp_math/index.html @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/zht/api/mp_math/line.html b/zht/api/mp_math/line.html index 7aa91a4..6817093 100644 --- a/zht/api/mp_math/line.html +++ b/zht/api/mp_math/line.html @@ -195,7 +195,7 @@ """ return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
- + \ No newline at end of file diff --git a/zht/api/mp_math/mp_math_typing.html b/zht/api/mp_math/mp_math_typing.html index f871790..e5133ec 100644 --- a/zht/api/mp_math/mp_math_typing.html +++ b/zht/api/mp_math/mp_math_typing.html @@ -18,7 +18,7 @@
Skip to content

var RealNumber = int | float

  • 類型: TypeAlias

  • 説明: 实数

var Number = RealNumber | complex

  • 類型: TypeAlias

  • 説明: 数

var SingleVar = TypeVar('SingleVar', bound=Number)

  • 説明: 单变量

var ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])

  • 説明: 数组变量

var Var = SingleVar | ArrayVar

  • 類型: TypeAlias

  • 説明: 变量

var OneSingleVarFunc = Callable[[SingleVar], SingleVar]

  • 類型: TypeAlias

  • 説明: 一元单变量函数

var OneArrayFunc = Callable[[ArrayVar], ArrayVar]

  • 類型: TypeAlias

  • 説明: 一元数组函数

var OneVarFunc = OneSingleVarFunc | OneArrayFunc

  • 類型: TypeAlias

  • 説明: 一元函数

var TwoSingleVarsFunc = Callable[[SingleVar, SingleVar], SingleVar]

  • 類型: TypeAlias

  • 説明: 二元单变量函数

var TwoArraysFunc = Callable[[ArrayVar, ArrayVar], ArrayVar]

  • 類型: TypeAlias

  • 説明: 二元数组函数

var TwoVarsFunc = TwoSingleVarsFunc | TwoArraysFunc

  • 類型: TypeAlias

  • 説明: 二元函数

var ThreeSingleVarsFunc = Callable[[SingleVar, SingleVar, SingleVar], SingleVar]

  • 類型: TypeAlias

  • 説明: 三元单变量函数

var ThreeArraysFunc = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar]

  • 類型: TypeAlias

  • 説明: 三元数组函数

var ThreeVarsFunc = ThreeSingleVarsFunc | ThreeArraysFunc

  • 類型: TypeAlias

  • 説明: 三元函数

var MultiSingleVarsFunc = Callable[..., SingleVar]

  • 類型: TypeAlias

  • 説明: 多元单变量函数

var MultiArraysFunc = Callable[..., ArrayVar]

  • 類型: TypeAlias

  • 説明: 多元数组函数

var MultiVarsFunc = MultiSingleVarsFunc | MultiArraysFunc

  • 類型: TypeAlias

  • 説明: 多元函数

- + \ No newline at end of file diff --git a/zht/api/mp_math/plane.html b/zht/api/mp_math/plane.html index c750250..2ef3cb9 100644 --- a/zht/api/mp_math/plane.html +++ b/zht/api/mp_math/plane.html @@ -213,7 +213,7 @@ raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

method __eq__(self, other) -> bool

源碼
python
def __eq__(self, other) -> bool:
     return self.approx(other)

method __rand__(self, other: Line3) -> Point3

源碼
python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)
- + \ No newline at end of file diff --git a/zht/api/mp_math/point.html b/zht/api/mp_math/point.html index 3ea19c6..0859018 100644 --- a/zht/api/mp_math/point.html +++ b/zht/api/mp_math/point.html @@ -68,7 +68,7 @@ """ from .vector import Vector3 return Vector3(self.x - other.x, self.y - other.y, self.z - other.z) - + \ No newline at end of file diff --git a/zht/api/mp_math/segment.html b/zht/api/mp_math/segment.html index c161f8a..f934193 100644 --- a/zht/api/mp_math/segment.html +++ b/zht/api/mp_math/segment.html @@ -31,7 +31,7 @@ self.length = self.direction.length '中心点' self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2) - + \ No newline at end of file diff --git a/zht/api/mp_math/utils.html b/zht/api/mp_math/utils.html index cad97d7..3b1c24b 100644 --- a/zht/api/mp_math/utils.html +++ b/zht/api/mp_math/utils.html @@ -81,7 +81,7 @@ self.raise_type_error(other)

method raise_type_error(self, other)

源碼
python
def raise_type_error(self, other):
     raise TypeError(f'Unsupported type: {type(self.value)} and {type(other)}')

method __ne__(self, other)

源碼
python
def __ne__(self, other):
     return not self.__eq__(other)
- + \ No newline at end of file diff --git a/zht/api/mp_math/vector.html b/zht/api/mp_math/vector.html index 4166fa4..38e55ff 100644 --- a/zht/api/mp_math/vector.html +++ b/zht/api/mp_math/vector.html @@ -204,7 +204,7 @@ return self.x * other.x + self.y * other.y + self.z * other.z

method self / other: RealNumber => Vector3

源碼
python
def __truediv__(self, other: RealNumber) -> 'Vector3':
     return Vector3(self.x / other, self.y / other, self.z / other)

method - self

源碼
python
def __neg__(self):
     return Vector3(-self.x, -self.y, -self.z)

var zero_vector3 = Vector3(0, 0, 0)

var x_axis = Vector3(1, 0, 0)

var y_axis = Vector3(0, 1, 0)

var z_axis = Vector3(0, 0, 1)

- + \ No newline at end of file diff --git a/zht/api/particle/index.html b/zht/api/particle/index.html index 5d9221f..b871c19 100644 --- a/zht/api/particle/index.html +++ b/zht/api/particle/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/zht/api/presets/index.html b/zht/api/presets/index.html index 58245ee..e2aa364 100644 --- a/zht/api/presets/index.html +++ b/zht/api/presets/index.html @@ -18,7 +18,7 @@
Skip to content
- + \ No newline at end of file diff --git a/zht/api/presets/model/index.html b/zht/api/presets/model/index.html index 929eb62..afd8598 100644 --- a/zht/api/presets/model/index.html +++ b/zht/api/presets/model/index.html @@ -35,7 +35,7 @@ y_array = radius * np.sin(phi_list) * np.sin(theta_list) z_array = radius * np.cos(phi_list) return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)] - + \ No newline at end of file