diff --git a/404.html b/404.html index 111ccae..30e4a82 100644 --- a/404.html +++ b/404.html @@ -6,7 +6,7 @@ 404 | MBCP 文档 - + @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/api/api.html b/api/api.html index 05dbda4..305a073 100644 --- a/api/api.html +++ b/api/api.html @@ -6,7 +6,7 @@ mbcp | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp

说明: 本模块塞了一些预设的粒子生成器

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/index.html b/api/index.html index 842874c..e821e53 100644 --- a/api/index.html +++ b/api/index.html @@ -6,7 +6,7 @@ mbcp | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp

说明: 本模块塞了一些预设的粒子生成器

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/angle.html b/api/mp_math/angle.html index 9307fc0..b2a9291 100644 --- a/api/mp_math/angle.html +++ b/api/mp_math/angle.html @@ -6,19 +6,19 @@ mbcp.mp_math.angle | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.angle

说明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

说明: 任意角度。

参数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源代码
python
def __init__(self, value: float, is_radian: bool=False):
+    
Skip to content

mbcp.mp_math.angle

说明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

说明: 任意角度。

参数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源代码

在GitHub上查看

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -28,96 +28,96 @@
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

说明: 余角:两角的和为90°。

返回: 余角

源代码
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

说明: 余角:两角的和为90°。

返回: 余角

源代码

在GitHub上查看

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

说明: 补角:两角的和为180°。

返回: 补角

源代码
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

说明: 补角:两角的和为180°。

返回: 补角

源代码

在GitHub上查看

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

说明: 角度。

返回: 弧度

源代码
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

说明: 角度。

返回: 弧度

源代码

在GitHub上查看

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

说明: 最小正角。

返回: 最小正角度

源代码
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

说明: 最小正角。

返回: 最小正角度

源代码

在GitHub上查看

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

说明: 最大负角。

返回: 最大负角度

源代码
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

说明: 最大负角。

返回: 最大负角度

源代码

在GitHub上查看

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

说明: 正弦值。

返回: 正弦值

源代码
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

说明: 正弦值。

返回: 正弦值

源代码

在GitHub上查看

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

说明: 余弦值。

返回: 余弦值

源代码
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

说明: 余弦值。

返回: 余弦值

源代码

在GitHub上查看

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

说明: 正切值。

返回: 正切值

源代码
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

说明: 正切值。

返回: 正切值

源代码

在GitHub上查看

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

说明: 余切值。

返回: 余切值

源代码
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

说明: 余切值。

返回: 余切值

源代码

在GitHub上查看

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

说明: 正割值。

返回: 正割值

源代码
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

说明: 正割值。

返回: 正割值

源代码

在GitHub上查看

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

说明: 余割值。

返回: 余割值

源代码
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

说明: 余割值。

返回: 余割值

源代码

在GitHub上查看

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源代码
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

源代码
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源代码
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源代码
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源代码

在GitHub上查看

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

源代码

在GitHub上查看

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

源代码

在GitHub上查看

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源代码

在GitHub上查看

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源代码

在GitHub上查看

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

源代码
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

源代码

在GitHub上查看

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

源代码
python
def __truediv__(self, other):
+    ...

def self / other

源代码

在GitHub上查看

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
     return AnyAngle(self.radian / other, is_radian=True)

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/const.html b/api/mp_math/const.html index 697b377..eb4ddcc 100644 --- a/api/mp_math/const.html +++ b/api/mp_math/const.html @@ -6,7 +6,7 @@ mbcp.mp_math.const | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.const

说明: 本模块定义了一些常用的常量

var PI = math.pi

  • 说明: 常量 π

var E = math.e

  • 说明: 自然对数的底 exp(1)

var GOLDEN_RATIO = (1 + math.sqrt(5)) / 2

  • 说明: 黄金分割比

var GAMMA = 0.5772156649015329

  • 说明: 欧拉常数

var EPSILON = 0.0001

  • 说明: 精度误差

var APPROX = 0.001

  • 说明: 约等于判定误差

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/equation.html b/api/mp_math/equation.html index 1bf23a2..dcbd5a7 100644 --- a/api/mp_math/equation.html +++ b/api/mp_math/equation.html @@ -6,19 +6,19 @@ mbcp.mp_math.equation | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.equation

说明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+    
Skip to content

mbcp.mp_math.equation

说明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码

在GitHub上查看

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:

返回: 目标点

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

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

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:

返回: 目标点

源代码

在GitHub上查看

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -40,7 +40,7 @@
     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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

参数:

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

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

参数:

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

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码

在GitHub上查看

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -83,7 +83,7 @@
         return high_order_partial_derivative_func
     else:
         raise ValueError('Invalid var type')

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/function.html b/api/mp_math/function.html index 63bfe46..537e647 100644 --- a/api/mp_math/function.html +++ b/api/mp_math/function.html @@ -6,19 +6,19 @@ mbcp.mp_math.function | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.function

说明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

说明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

参数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源代码
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+    
Skip to content

mbcp.mp_math.function

说明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

说明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

参数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源代码

在GitHub上查看

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -37,7 +37,7 @@
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

参数:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

示例:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
源代码
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
源代码

在GitHub上查看

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -60,7 +60,7 @@
         """@litedoc-hide"""
         return func(*args, *args2)
     return curried_func

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/index.html b/api/mp_math/index.html index 58d46e9..a05c9d6 100644 --- a/api/mp_math/index.html +++ b/api/mp_math/index.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

说明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/line.html b/api/mp_math/line.html index 8e7ad23..6d79520 100644 --- a/api/mp_math/line.html +++ b/api/mp_math/line.html @@ -6,19 +6,19 @@ mbcp.mp_math.line | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.line

说明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

说明: 三维空间中的直线。由一个点和一个方向向量确定。

参数:

  • point: 直线上的一点
  • direction: 直线的方向向量
源代码
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+    
Skip to content

mbcp.mp_math.line

说明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

说明: 三维空间中的直线。由一个点和一个方向向量确定。

参数:

  • point: 直线上的一点
  • direction: 直线的方向向量
源代码

在GitHub上查看

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -26,7 +26,7 @@
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

说明: 判断两条直线是否近似相等。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源代码
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

说明: 判断两条直线是否近似相等。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -35,7 +35,7 @@
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

说明: 计算直线和直线之间的夹角。

参数:

  • other: 另一条直线

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

说明: 计算直线和直线之间的夹角。

参数:

  • other: 另一条直线

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -45,7 +45,7 @@
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

说明: 计算直线和直线或点之间的距离。

参数:

  • other: 平行直线或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

说明: 计算直线和直线或点之间的距离。

参数:

  • other: 平行直线或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -68,7 +68,7 @@
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

说明: 计算两条直线的交点。

参数:

  • other: 另一条直线

返回: 交点

引发:

  • ValueError 直线平行
  • ValueError 直线不共面
源代码
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

说明: 计算两条直线的交点。

参数:

  • other: 另一条直线

返回: 交点

引发:

  • ValueError 直线平行
  • ValueError 直线不共面
源代码

在GitHub上查看

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -83,7 +83,7 @@
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

说明: 计算直线经过指定点p的垂线。

参数:

  • point: 指定点

返回: 垂线

源代码
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

说明: 计算直线经过指定点p的垂线。

参数:

  • point: 指定点

返回: 垂线

源代码

在GitHub上查看

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -91,7 +91,7 @@
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

说明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

参数:

  • t: 参数t

返回: 点

源代码
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

说明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

参数:

  • t: 参数t

返回: 点

源代码

在GitHub上查看

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -99,13 +99,13 @@
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

说明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源代码
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

说明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源代码

在GitHub上查看

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

说明: 判断两条直线是否近似平行。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源代码
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

说明: 判断两条直线是否近似平行。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源代码

在GitHub上查看

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -114,7 +114,7 @@
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

说明: 判断两条直线是否平行。

参数:

  • other: 另一条直线

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

说明: 判断两条直线是否平行。

参数:

  • other: 另一条直线

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -122,7 +122,7 @@
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

说明: 判断两条直线是否共线。

参数:

  • other: 另一条直线

返回: 是否共线

源代码
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

说明: 判断两条直线是否共线。

参数:

  • other: 另一条直线

返回: 是否共线

源代码

在GitHub上查看

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -130,7 +130,7 @@
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

说明: 判断点是否在直线上。

参数:

  • point: 点

返回: 是否在直线上

源代码
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

说明: 判断点是否在直线上。

参数:

  • point: 点

返回: 是否在直线上

源代码

在GitHub上查看

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -138,7 +138,7 @@
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

说明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

参数:

  • other: 另一条直线

返回: 是否共面

源代码
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

说明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

参数:

  • other: 另一条直线

返回: 是否共面

源代码

在GitHub上查看

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -147,7 +147,7 @@
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

说明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源代码
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

说明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源代码

在GitHub上查看

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -160,7 +160,7 @@
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

说明: 工厂函数 由两点构造直线。

参数:

  • p1: 点1
  • p2: 点2

返回: 直线

源代码
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

说明: 工厂函数 由两点构造直线。

参数:

  • p1: 点1
  • p2: 点2

返回: 直线

源代码

在GitHub上查看

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -171,7 +171,7 @@
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

说明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

参数:

  • other: 另一条直线

返回: 交点

源代码
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

说明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

参数:

  • other: 另一条直线

返回: 交点

源代码

在GitHub上查看

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -184,7 +184,7 @@
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

说明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

参数:

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

def __eq__(self, other) -> bool

说明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

参数:

  • other:
源代码

在GitHub上查看

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -196,7 +196,7 @@
 
         """
     return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/mp_math.html b/api/mp_math/mp_math.html index 450093f..616f9e6 100644 --- a/api/mp_math/mp_math.html +++ b/api/mp_math/mp_math.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

说明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ 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 36d90cd..f75a7e6 100644 --- a/api/mp_math/mp_math_typing.html +++ b/api/mp_math/mp_math_typing.html @@ -6,7 +6,7 @@ mbcp.mp_math.mp_math_typing | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.mp_math_typing

说明: 本模块用于内部类型提示

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

  • 说明: 多元函数

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/plane.html b/api/mp_math/plane.html index f958de4..c8101b0 100644 --- a/api/mp_math/plane.html +++ b/api/mp_math/plane.html @@ -6,19 +6,19 @@ mbcp.mp_math.plane | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.plane

说明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

说明: 平面方程:ax + by + cz + d = 0

参数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源代码
python
def __init__(self, a: float, b: float, c: float, d: float):
+    
Skip to content

mbcp.mp_math.plane

说明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

说明: 平面方程:ax + by + cz + d = 0

参数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源代码

在GitHub上查看

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -30,7 +30,7 @@
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

说明: 判断两个平面是否近似相等。

参数:

  • other: 另一个平面

返回: 是否近似相等

源代码
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

说明: 判断两个平面是否近似相等。

参数:

  • other: 另一个平面

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -48,7 +48,7 @@
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

说明: 计算平面与平面之间的夹角。

参数:

  • other: 另一个平面

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

说明: 计算平面与平面之间的夹角。

参数:

  • other: 另一个平面

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -63,7 +63,7 @@
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

说明: 计算平面与平面或点之间的距离。

参数:

  • other: 另一个平面或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

说明: 计算平面与平面或点之间的距离。

参数:

  • other: 另一个平面或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -78,7 +78,7 @@
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

说明: 计算两平面的交线。

参数:

  • other: 另一个平面

返回: 两平面的交线

源代码
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

说明: 计算两平面的交线。

参数:

  • other: 另一个平面

返回: 两平面的交线

源代码

在GitHub上查看

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -103,7 +103,7 @@
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

说明: 计算平面与直线的交点。

参数:

  • other: 不与平面平行或在平面上的直线

返回: 交点

引发:

  • ValueError 平面与直线平行或重合
源代码
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

说明: 计算平面与直线的交点。

参数:

  • other: 不与平面平行或在平面上的直线

返回: 交点

引发:

  • ValueError 平面与直线平行或重合
源代码

在GitHub上查看

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -117,7 +117,7 @@
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

说明: 计算平行于该平面且过指定点的平面。

参数:

  • point: 指定点

返回: 所求平面

源代码
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

说明: 计算平行于该平面且过指定点的平面。

参数:

  • point: 指定点

返回: 所求平面

源代码

在GitHub上查看

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -125,7 +125,7 @@
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

说明: 判断两个平面是否平行。

参数:

  • other: 另一个平面

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

说明: 判断两个平面是否平行。

参数:

  • other: 另一个平面

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -133,14 +133,14 @@
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

说明: 平面的法向量。

返回: 法向量

源代码
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

说明: 平面的法向量。

返回: 法向量

源代码

在GitHub上查看

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

说明: 工厂函数 由点和法向量构造平面(点法式构造)。

参数:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源代码
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

说明: 工厂函数 由点和法向量构造平面(点法式构造)。

参数:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -152,7 +152,7 @@
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

说明: 工厂函数 由三点构造平面。

参数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源代码
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

说明: 工厂函数 由三点构造平面。

参数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -166,7 +166,7 @@
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

说明: 工厂函数 由两直线构造平面。

参数:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源代码
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

说明: 工厂函数 由两直线构造平面。

参数:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -180,7 +180,7 @@
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

说明: 工厂函数 由点和直线构造平面。

参数:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源代码
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

说明: 工厂函数 由点和直线构造平面。

参数:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -190,11 +190,11 @@
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源代码
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源代码

在GitHub上查看

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源代码
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源代码

在GitHub上查看

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

说明: 取两平面的交集(人话:交线)

参数:

  • other:

返回: 不平行平面的交线,平面平行返回None

源代码
python
def __and__(self, other):
+    ...

def __and__(self, other)

说明: 取两平面的交集(人话:交线)

参数:

  • other:

返回: 不平行平面的交线,平面平行返回None

源代码

在GitHub上查看

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -211,10 +211,10 @@
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

源代码
python
def __rand__(self, other: 'Line3') -> 'Point3':
+        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

源代码

在GitHub上查看

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

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

源代码

在GitHub上查看

python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/point.html b/api/mp_math/point.html index 3823cd7..86247ce 100644 --- a/api/mp_math/point.html +++ b/api/mp_math/point.html @@ -6,19 +6,19 @@ mbcp.mp_math.point | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.point

说明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

说明: 笛卡尔坐标系中的点。

参数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源代码
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.point

说明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

说明: 笛卡尔坐标系中的点。

参数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源代码

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

说明: 判断两个点是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

说明: 判断两个点是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -38,11 +38,11 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源代码
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

说明: P + V -> P P + P -> P

参数:

  • other:
源代码
python
def __add__(self, other):
+    ...

def self + other

说明: P + V -> P P + P -> P

参数:

  • other:
源代码

在GitHub上查看

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -50,14 +50,14 @@
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

说明: 判断两个点是否相等。

参数:

  • other:
源代码
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

说明: 判断两个点是否相等。

参数:

  • other:
源代码

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

说明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

参数:

  • other:
源代码
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

说明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

参数:

  • other:
源代码

在GitHub上查看

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -69,7 +69,7 @@
         """
     from .vector import Vector3
     return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/segment.html b/api/mp_math/segment.html index fbfdab6..75fd5b6 100644 --- a/api/mp_math/segment.html +++ b/api/mp_math/segment.html @@ -6,19 +6,19 @@ mbcp.mp_math.segment | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.segment

说明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

说明: 三维空间中的线段。 :param p1: :param p2:

源代码
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+    
Skip to content

mbcp.mp_math.segment

说明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

说明: 三维空间中的线段。 :param p1: :param p2:

源代码

在GitHub上查看

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -32,7 +32,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)

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/utils.html b/api/mp_math/utils.html index de95a48..63cba0b 100644 --- a/api/mp_math/utils.html +++ b/api/mp_math/utils.html @@ -6,19 +6,19 @@ mbcp.mp_math.utils | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.utils

说明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

说明: 区间限定函数

参数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源代码
python
def clamp(x: float, min_: float, max_: float) -> float:
+    
Skip to content

mbcp.mp_math.utils

说明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

说明: 区间限定函数

参数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源代码

在GitHub上查看

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -29,8 +29,8 @@
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源代码
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

源代码
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源代码

在GitHub上查看

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

源代码

在GitHub上查看

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -40,9 +40,9 @@
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

源代码
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

说明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

参数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源代码
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

源代码

在GitHub上查看

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

def __ne__(self, other)

源代码

在GitHub上查看

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

说明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

参数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -52,7 +52,7 @@
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

说明: 获取数的符号。

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

说明: 获取数的符号。

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码

在GitHub上查看

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -65,7 +65,7 @@
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

说明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

说明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码

在GitHub上查看

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -82,7 +82,7 @@
         return f'-{abs(x)}'
     else:
         return ''

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/mp_math/vector.html b/api/mp_math/vector.html index c941895..460f386 100644 --- a/api/mp_math/vector.html +++ b/api/mp_math/vector.html @@ -6,19 +6,19 @@ mbcp.mp_math.vector | MBCP 文档 - + - + -
Skip to content

mbcp.mp_math.vector

说明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

说明: 3维向量

参数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源代码
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.vector

说明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

说明: 3维向量

参数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源代码

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -38,7 +38,7 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

说明: 计算两个向量之间的夹角。

参数:

  • other: 另一个向量

返回: 夹角

源代码
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

说明: 计算两个向量之间的夹角。

参数:

  • other: 另一个向量

返回: 夹角

源代码

在GitHub上查看

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -46,7 +46,7 @@
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

说明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

参数:

  • other:

返回: 行列式的结果

源代码
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

说明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

参数:

  • other:

返回: 行列式的结果

源代码

在GitHub上查看

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -66,7 +66,7 @@
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似平行。

参数:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源代码
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似平行。

参数:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源代码

在GitHub上查看

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -75,7 +75,7 @@
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

说明: 判断两个向量是否平行。

参数:

  • other: 另一个向量

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

说明: 判断两个向量是否平行。

参数:

  • other: 另一个向量

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -83,7 +83,7 @@
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

说明: 将向量归一化。

自体归一化,不返回值。

源代码
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

说明: 将向量归一化。

自体归一化,不返回值。

源代码

在GitHub上查看

python
def normalize(self):
     """
         将向量归一化。
 
@@ -92,32 +92,32 @@
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

源代码
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

源代码

在GitHub上查看

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

说明: 向量的模。

返回: 模

源代码
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

说明: 向量的模。

返回: 模

源代码

在GitHub上查看

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

说明: 获取该向量的单位向量。

返回: 单位向量

源代码
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

说明: 获取该向量的单位向量。

返回: 单位向量

源代码

在GitHub上查看

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

源代码
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

源代码
python
@overload
+    return self / self.length

def __abs__(self)

源代码

在GitHub上查看

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

说明: V + P -> P

V + V -> V

参数:

  • other:
源代码
python
def __add__(self, other):
+    ...

def self + other

说明: V + P -> P

V + V -> V

参数:

  • other:
源代码

在GitHub上查看

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -132,7 +132,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

说明: 判断两个向量是否相等。

参数:

  • other:

返回: 是否相等

源代码
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

说明: 判断两个向量是否相等。

参数:

  • other:

返回: 是否相等

源代码

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -140,7 +140,7 @@
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

说明: P + V -> P

别去点那边实现了。 :param other: :return:

源代码
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

说明: P + V -> P

别去点那边实现了。 :param other: :return:

源代码

在GitHub上查看

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -148,11 +148,11 @@
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源代码
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

说明: V - P -> P

V - V -> V

参数:

  • other:
源代码
python
def __sub__(self, other):
+    ...

def self - other

说明: V - P -> P

V - V -> V

参数:

  • other:
源代码

在GitHub上查看

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -166,7 +166,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

说明: P - V -> P

参数:

  • other:
源代码
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

说明: P - V -> P

参数:

  • other:
源代码

在GitHub上查看

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -177,11 +177,11 @@
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源代码
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

源代码
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

源代码

在GitHub上查看

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

说明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

参数:

  • other:
源代码
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

说明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

参数:

  • other:
源代码

在GitHub上查看

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -194,18 +194,18 @@
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源代码
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

说明: 点乘。

参数:

  • other:
源代码
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源代码

在GitHub上查看

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

说明: 点乘。

参数:

  • other:
源代码

在GitHub上查看

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

源代码
python
def __neg__(self):
+    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

源代码

在GitHub上查看

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

def - self

源代码

在GitHub上查看

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

var zero_vector3 = Vector3(0, 0, 0)

  • 类型: Vector3

  • 说明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 类型: Vector3

  • 说明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 类型: Vector3

  • 说明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 类型: Vector3

  • 说明: z轴单位向量

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/particle/index.html b/api/particle/index.html index 8685e8a..8c87a92 100644 --- a/api/particle/index.html +++ b/api/particle/index.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP 文档 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/api/particle/particle.html b/api/particle/particle.html index 35a6b58..220e8ce 100644 --- a/api/particle/particle.html +++ b/api/particle/particle.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP 文档 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/api/presets/index.html b/api/presets/index.html index cd30ab2..51d348e 100644 --- a/api/presets/index.html +++ b/api/presets/index.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

说明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/presets/model/index.html b/api/presets/model/index.html index 4cfafb3..b97727a 100644 --- a/api/presets/model/index.html +++ b/api/presets/model/index.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP 文档 - + - + -
Skip to content

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码
python
@staticmethod
+    
Skip to content

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/presets/model/model.html b/api/presets/model/model.html index 8d7191e..45bb898 100644 --- a/api/presets/model/model.html +++ b/api/presets/model/model.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP 文档 - + - + -
Skip to content

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码
python
@staticmethod
+    
Skip to content

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/api/presets/presets.html b/api/presets/presets.html index af37783..560e419 100644 --- a/api/presets/presets.html +++ b/api/presets/presets.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

说明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/assets/api_mp_math_angle.md.vKQLLqTS.js b/assets/api_mp_math_angle.md.bQbgL5rc.js similarity index 75% rename from assets/api_mp_math_angle.md.vKQLLqTS.js rename to assets/api_mp_math_angle.md.bQbgL5rc.js index 31fd76e..7f11e61 100644 --- a/assets/api_mp_math_angle.md.vKQLLqTS.js +++ b/assets/api_mp_math_angle.md.bQbgL5rc.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),t={name:"api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

说明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

说明: 任意角度。

参数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源代码
python
def __init__(self, value: float, is_radian: bool=False):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),t={name:"api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

说明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

说明: 任意角度。

参数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源代码

在GitHub上查看

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -8,92 +8,92 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

说明: 余角:两角的和为90°。

返回: 余角

源代码
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

说明: 余角:两角的和为90°。

返回: 余角

源代码

在GitHub上查看

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

说明: 补角:两角的和为180°。

返回: 补角

源代码
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

说明: 补角:两角的和为180°。

返回: 补角

源代码

在GitHub上查看

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

说明: 角度。

返回: 弧度

源代码
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

说明: 角度。

返回: 弧度

源代码

在GitHub上查看

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

说明: 最小正角。

返回: 最小正角度

源代码
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

说明: 最小正角。

返回: 最小正角度

源代码

在GitHub上查看

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

说明: 最大负角。

返回: 最大负角度

源代码
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

说明: 最大负角。

返回: 最大负角度

源代码

在GitHub上查看

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

说明: 正弦值。

返回: 正弦值

源代码
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

说明: 正弦值。

返回: 正弦值

源代码

在GitHub上查看

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

说明: 余弦值。

返回: 余弦值

源代码
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

说明: 余弦值。

返回: 余弦值

源代码

在GitHub上查看

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

说明: 正切值。

返回: 正切值

源代码
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

说明: 正切值。

返回: 正切值

源代码

在GitHub上查看

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

说明: 余切值。

返回: 余切值

源代码
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

说明: 余切值。

返回: 余切值

源代码

在GitHub上查看

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

说明: 正割值。

返回: 正割值

源代码
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

说明: 正割值。

返回: 正割值

源代码

在GitHub上查看

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

说明: 余割值。

返回: 余割值

源代码
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

说明: 余割值。

返回: 余割值

源代码

在GitHub上查看

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源代码
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

源代码
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源代码
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源代码
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源代码

在GitHub上查看

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

源代码

在GitHub上查看

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

源代码

在GitHub上查看

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源代码

在GitHub上查看

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源代码

在GitHub上查看

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

源代码
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

源代码

在GitHub上查看

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

源代码
python
def __truediv__(self, other):
+    ...

def self / other

源代码

在GitHub上查看

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
-    return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; + return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/api_mp_math_angle.md.vKQLLqTS.lean.js b/assets/api_mp_math_angle.md.bQbgL5rc.lean.js similarity index 72% rename from assets/api_mp_math_angle.md.vKQLLqTS.lean.js rename to assets/api_mp_math_angle.md.bQbgL5rc.lean.js index 9e9de3c..ffcb2ce 100644 --- a/assets/api_mp_math_angle.md.vKQLLqTS.lean.js +++ b/assets/api_mp_math_angle.md.bQbgL5rc.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),t={name:"api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),t={name:"api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/api_mp_math_equation.md.B2FeM0MH.lean.js b/assets/api_mp_math_equation.md.B2FeM0MH.lean.js deleted file mode 100644 index 57f0afc..0000000 --- a/assets/api_mp_math_equation.md.B2FeM0MH.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n("",23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; diff --git a/assets/api_mp_math_equation.md.B2FeM0MH.js b/assets/api_mp_math_equation.md.hWRUu0yD.js similarity index 83% rename from assets/api_mp_math_equation.md.B2FeM0MH.js rename to assets/api_mp_math_equation.md.hWRUu0yD.js index be7c233..dabb675 100644 --- a/assets/api_mp_math_equation.md.B2FeM0MH.js +++ b/assets/api_mp_math_equation.md.hWRUu0yD.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),l={name:"api/mp_math/equation.md"},t=n(`

mbcp.mp_math.equation

说明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n(`

mbcp.mp_math.equation

说明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

说明: 曲线方程。

参数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源代码

在GitHub上查看

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:

返回: 目标点

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

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

说明: 计算曲线上的点。

参数:

  • *t:
  • 参数:

返回: 目标点

源代码

在GitHub上查看

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

参数:

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

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

参数:

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

返回: 偏导函数

引发:

  • ValueError 无效变量类型
源代码

在GitHub上查看

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')
`,23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; + raise ValueError('Invalid var type')
`,23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/api_mp_math_equation.md.hWRUu0yD.lean.js b/assets/api_mp_math_equation.md.hWRUu0yD.lean.js new file mode 100644 index 0000000..0b18e29 --- /dev/null +++ b/assets/api_mp_math_equation.md.hWRUu0yD.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n("",23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/api_mp_math_function.md.BnSMoIoo.js b/assets/api_mp_math_function.md.C9eBzKgT.js similarity index 96% rename from assets/api_mp_math_function.md.BnSMoIoo.js rename to assets/api_mp_math_function.md.C9eBzKgT.js index 7201cde..7c91927 100644 --- a/assets/api_mp_math_function.md.BnSMoIoo.js +++ b/assets/api_mp_math_function.md.C9eBzKgT.js @@ -1,4 +1,4 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),e={name:"api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

说明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

说明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

参数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源代码
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),e={name:"api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

说明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

说明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

参数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源代码

在GitHub上查看

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -17,7 +17,7 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

参数:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

示例:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
源代码
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
源代码

在GitHub上查看

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -39,4 +39,4 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     def curried_func(*args2: Var) -> Var:
         """@litedoc-hide"""
         return func(*args, *args2)
-    return curried_func
`,13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; + return curried_func
`,13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/api_mp_math_function.md.BnSMoIoo.lean.js b/assets/api_mp_math_function.md.C9eBzKgT.lean.js similarity index 98% rename from assets/api_mp_math_function.md.BnSMoIoo.lean.js rename to assets/api_mp_math_function.md.C9eBzKgT.lean.js index 9270086..0b7d0ef 100644 --- a/assets/api_mp_math_function.md.BnSMoIoo.lean.js +++ b/assets/api_mp_math_function.md.C9eBzKgT.lean.js @@ -1 +1 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),e={name:"api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; +import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),e={name:"api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/api_mp_math_line.md.DPWL9O-M.js b/assets/api_mp_math_line.md.DDkzT0e0.js similarity index 76% rename from assets/api_mp_math_line.md.DPWL9O-M.js rename to assets/api_mp_math_line.md.DDkzT0e0.js index c39f908..c26762d 100644 --- a/assets/api_mp_math_line.md.DPWL9O-M.js +++ b/assets/api_mp_math_line.md.DDkzT0e0.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"zh/api/mp_math/line.md"}'),l={name:"api/mp_math/line.md"},t=n(`

mbcp.mp_math.line

说明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

说明: 三维空间中的直线。由一个点和一个方向向量确定。

参数:

  • point: 直线上的一点
  • direction: 直线的方向向量
源代码
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"zh/api/mp_math/line.md"}'),t={name:"api/mp_math/line.md"},l=n(`

mbcp.mp_math.line

说明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

说明: 三维空间中的直线。由一个点和一个方向向量确定。

参数:

  • point: 直线上的一点
  • direction: 直线的方向向量
源代码

在GitHub上查看

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -6,7 +6,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

说明: 判断两条直线是否近似相等。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源代码
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

说明: 判断两条直线是否近似相等。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

说明: 计算直线和直线之间的夹角。

参数:

  • other: 另一条直线

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

说明: 计算直线和直线之间的夹角。

参数:

  • other: 另一条直线

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -25,7 +25,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

说明: 计算直线和直线或点之间的距离。

参数:

  • other: 平行直线或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

说明: 计算直线和直线或点之间的距离。

参数:

  • other: 平行直线或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

说明: 计算两条直线的交点。

参数:

  • other: 另一条直线

返回: 交点

引发:

  • ValueError 直线平行
  • ValueError 直线不共面
源代码
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

说明: 计算两条直线的交点。

参数:

  • other: 另一条直线

返回: 交点

引发:

  • ValueError 直线平行
  • ValueError 直线不共面
源代码

在GitHub上查看

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

说明: 计算直线经过指定点p的垂线。

参数:

  • point: 指定点

返回: 垂线

源代码
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

说明: 计算直线经过指定点p的垂线。

参数:

  • point: 指定点

返回: 垂线

源代码

在GitHub上查看

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -71,7 +71,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

说明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

参数:

  • t: 参数t

返回: 点

源代码
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

说明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

参数:

  • t: 参数t

返回: 点

源代码

在GitHub上查看

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -79,13 +79,13 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

说明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源代码
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

说明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源代码

在GitHub上查看

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

说明: 判断两条直线是否近似平行。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源代码
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

说明: 判断两条直线是否近似平行。

参数:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源代码

在GitHub上查看

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -94,7 +94,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

说明: 判断两条直线是否平行。

参数:

  • other: 另一条直线

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

说明: 判断两条直线是否平行。

参数:

  • other: 另一条直线

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -102,7 +102,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

说明: 判断两条直线是否共线。

参数:

  • other: 另一条直线

返回: 是否共线

源代码
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

说明: 判断两条直线是否共线。

参数:

  • other: 另一条直线

返回: 是否共线

源代码

在GitHub上查看

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -110,7 +110,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

说明: 判断点是否在直线上。

参数:

  • point: 点

返回: 是否在直线上

源代码
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

说明: 判断点是否在直线上。

参数:

  • point: 点

返回: 是否在直线上

源代码

在GitHub上查看

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -118,7 +118,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

说明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

参数:

  • other: 另一条直线

返回: 是否共面

源代码
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

说明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

参数:

  • other: 另一条直线

返回: 是否共面

源代码

在GitHub上查看

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -127,7 +127,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

说明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源代码
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

说明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源代码

在GitHub上查看

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -140,7 +140,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

说明: 工厂函数 由两点构造直线。

参数:

  • p1: 点1
  • p2: 点2

返回: 直线

源代码
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

说明: 工厂函数 由两点构造直线。

参数:

  • p1: 点1
  • p2: 点2

返回: 直线

源代码

在GitHub上查看

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -151,7 +151,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

说明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

参数:

  • other: 另一条直线

返回: 交点

源代码
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

说明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

参数:

  • other: 另一条直线

返回: 交点

源代码

在GitHub上查看

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -164,7 +164,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

说明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

参数:

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

def __eq__(self, other) -> bool

说明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

参数:

  • other:
源代码

在GitHub上查看

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -175,4 +175,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; + return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/api_mp_math_line.md.DPWL9O-M.lean.js b/assets/api_mp_math_line.md.DDkzT0e0.lean.js similarity index 57% rename from assets/api_mp_math_line.md.DPWL9O-M.lean.js rename to assets/api_mp_math_line.md.DDkzT0e0.lean.js index 29f45da..90e72a2 100644 --- a/assets/api_mp_math_line.md.DPWL9O-M.lean.js +++ b/assets/api_mp_math_line.md.DDkzT0e0.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"zh/api/mp_math/line.md"}'),l={name:"api/mp_math/line.md"},t=n("",107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"zh/api/mp_math/line.md"}'),t={name:"api/mp_math/line.md"},l=n("",107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/api_mp_math_plane.md.DTAJAb0P.js b/assets/api_mp_math_plane.md.DCL3lFbz.js similarity index 83% rename from assets/api_mp_math_plane.md.DTAJAb0P.js rename to assets/api_mp_math_plane.md.DCL3lFbz.js index a3869df..6c2294a 100644 --- a/assets/api_mp_math_plane.md.DTAJAb0P.js +++ b/assets/api_mp_math_plane.md.DCL3lFbz.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"api/mp_math/plane.md","filePath":"zh/api/mp_math/plane.md"}'),l={name:"api/mp_math/plane.md"},h=n(`

mbcp.mp_math.plane

说明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

说明: 平面方程:ax + by + cz + d = 0

参数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源代码
python
def __init__(self, a: float, b: float, c: float, d: float):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"api/mp_math/plane.md","filePath":"zh/api/mp_math/plane.md"}'),l={name:"api/mp_math/plane.md"},t=n(`

mbcp.mp_math.plane

说明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

说明: 平面方程:ax + by + cz + d = 0

参数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源代码

在GitHub上查看

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -10,7 +10,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

说明: 判断两个平面是否近似相等。

参数:

  • other: 另一个平面

返回: 是否近似相等

源代码
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

说明: 判断两个平面是否近似相等。

参数:

  • other: 另一个平面

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -28,7 +28,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

说明: 计算平面与平面之间的夹角。

参数:

  • other: 另一个平面

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

说明: 计算平面与平面之间的夹角。

参数:

  • other: 另一个平面

返回: 夹角弧度

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -43,7 +43,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

说明: 计算平面与平面或点之间的距离。

参数:

  • other: 另一个平面或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

说明: 计算平面与平面或点之间的距离。

参数:

  • other: 另一个平面或点

返回: 距离

引发:

  • TypeError 不支持的类型
源代码

在GitHub上查看

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

说明: 计算两平面的交线。

参数:

  • other: 另一个平面

返回: 两平面的交线

源代码
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

说明: 计算两平面的交线。

参数:

  • other: 另一个平面

返回: 两平面的交线

源代码

在GitHub上查看

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -83,7 +83,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

说明: 计算平面与直线的交点。

参数:

  • other: 不与平面平行或在平面上的直线

返回: 交点

引发:

  • ValueError 平面与直线平行或重合
源代码
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

说明: 计算平面与直线的交点。

参数:

  • other: 不与平面平行或在平面上的直线

返回: 交点

引发:

  • ValueError 平面与直线平行或重合
源代码

在GitHub上查看

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -97,7 +97,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

说明: 计算平行于该平面且过指定点的平面。

参数:

  • point: 指定点

返回: 所求平面

源代码
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

说明: 计算平行于该平面且过指定点的平面。

参数:

  • point: 指定点

返回: 所求平面

源代码

在GitHub上查看

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -105,7 +105,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

说明: 判断两个平面是否平行。

参数:

  • other: 另一个平面

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

说明: 判断两个平面是否平行。

参数:

  • other: 另一个平面

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -113,14 +113,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

说明: 平面的法向量。

返回: 法向量

源代码
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

说明: 平面的法向量。

返回: 法向量

源代码

在GitHub上查看

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

说明: 工厂函数 由点和法向量构造平面(点法式构造)。

参数:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源代码
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

说明: 工厂函数 由点和法向量构造平面(点法式构造)。

参数:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -132,7 +132,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

说明: 工厂函数 由三点构造平面。

参数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源代码
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

说明: 工厂函数 由三点构造平面。

参数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

说明: 工厂函数 由两直线构造平面。

参数:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源代码
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

说明: 工厂函数 由两直线构造平面。

参数:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -160,7 +160,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

说明: 工厂函数 由点和直线构造平面。

参数:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源代码
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

说明: 工厂函数 由点和直线构造平面。

参数:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源代码

在GitHub上查看

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -170,11 +170,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源代码
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源代码

在GitHub上查看

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源代码
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源代码

在GitHub上查看

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

说明: 取两平面的交集(人话:交线)

参数:

  • other:

返回: 不平行平面的交线,平面平行返回None

源代码
python
def __and__(self, other):
+    ...

def __and__(self, other)

说明: 取两平面的交集(人话:交线)

参数:

  • other:

返回: 不平行平面的交线,平面平行返回None

源代码

在GitHub上查看

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -191,6 +191,6 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

源代码
python
def __rand__(self, other: 'Line3') -> 'Point3':
-    return self.cal_intersection_point3(other)
`,105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; + raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

源代码

在GitHub上查看

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

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

源代码

在GitHub上查看

python
def __rand__(self, other: 'Line3') -> 'Point3':
+    return self.cal_intersection_point3(other)
`,105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/api_mp_math_plane.md.DTAJAb0P.lean.js b/assets/api_mp_math_plane.md.DCL3lFbz.lean.js similarity index 58% rename from assets/api_mp_math_plane.md.DTAJAb0P.lean.js rename to assets/api_mp_math_plane.md.DCL3lFbz.lean.js index a41a37c..1398a50 100644 --- a/assets/api_mp_math_plane.md.DTAJAb0P.lean.js +++ b/assets/api_mp_math_plane.md.DCL3lFbz.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"api/mp_math/plane.md","filePath":"zh/api/mp_math/plane.md"}'),l={name:"api/mp_math/plane.md"},h=n("",105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"api/mp_math/plane.md","filePath":"zh/api/mp_math/plane.md"}'),l={name:"api/mp_math/plane.md"},t=n("",105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/api_mp_math_point.md.vtgIded6.js b/assets/api_mp_math_point.md.Y0Sc19zU.js similarity index 73% rename from assets/api_mp_math_point.md.vtgIded6.js rename to assets/api_mp_math_point.md.Y0Sc19zU.js index 0929386..24efa5d 100644 --- a/assets/api_mp_math_point.md.vtgIded6.js +++ b/assets/api_mp_math_point.md.Y0Sc19zU.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),n={name:"api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

说明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

说明: 笛卡尔坐标系中的点。

参数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源代码
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),n={name:"api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

说明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

说明: 笛卡尔坐标系中的点。

参数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源代码

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

说明: 判断两个点是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

说明: 判断两个点是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -18,11 +18,11 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源代码
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

说明: P + V -> P P + P -> P

参数:

  • other:
源代码
python
def __add__(self, other):
+    ...

def self + other

说明: P + V -> P P + P -> P

参数:

  • other:
源代码

在GitHub上查看

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -30,14 +30,14 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

说明: 判断两个点是否相等。

参数:

  • other:
源代码
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

说明: 判断两个点是否相等。

参数:

  • other:
源代码

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

说明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

参数:

  • other:
源代码
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

说明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

参数:

  • other:
源代码

在GitHub上查看

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -48,4 +48,4 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
 
         """
     from .vector import Vector3
-    return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; + return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/api_mp_math_point.md.vtgIded6.lean.js b/assets/api_mp_math_point.md.Y0Sc19zU.lean.js similarity index 72% rename from assets/api_mp_math_point.md.vtgIded6.lean.js rename to assets/api_mp_math_point.md.Y0Sc19zU.lean.js index f1c7b94..223eb91 100644 --- a/assets/api_mp_math_point.md.vtgIded6.lean.js +++ b/assets/api_mp_math_point.md.Y0Sc19zU.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),n={name:"api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),n={name:"api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/api_mp_math_segment.md.D-8aRB8W.js b/assets/api_mp_math_segment.md.B-ptCnQ0.js similarity index 83% rename from assets/api_mp_math_segment.md.D-8aRB8W.js rename to assets/api_mp_math_segment.md.B-ptCnQ0.js index 858fe2f..15327af 100644 --- a/assets/api_mp_math_segment.md.D-8aRB8W.js +++ b/assets/api_mp_math_segment.md.B-ptCnQ0.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

说明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

说明: 三维空间中的线段。 :param p1: :param p2:

源代码
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

说明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

说明: 三维空间中的线段。 :param p1: :param p2:

源代码

在GitHub上查看

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -11,4 +11,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     '长度'
     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)
`,6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; + self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2)
`,6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/api_mp_math_segment.md.D-8aRB8W.lean.js b/assets/api_mp_math_segment.md.B-ptCnQ0.lean.js similarity index 58% rename from assets/api_mp_math_segment.md.D-8aRB8W.lean.js rename to assets/api_mp_math_segment.md.B-ptCnQ0.lean.js index 411b9f3..eca218f 100644 --- a/assets/api_mp_math_segment.md.D-8aRB8W.lean.js +++ b/assets/api_mp_math_segment.md.B-ptCnQ0.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n("",6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n("",6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/api_mp_math_utils.md.DaaoR634.lean.js b/assets/api_mp_math_utils.md.DaaoR634.lean.js deleted file mode 100644 index aa06c91..0000000 --- a/assets/api_mp_math_utils.md.DaaoR634.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},t=n("",35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/api_mp_math_utils.md.DaaoR634.js b/assets/api_mp_math_utils.md.mUQ56HGQ.js similarity index 71% rename from assets/api_mp_math_utils.md.DaaoR634.js rename to assets/api_mp_math_utils.md.mUQ56HGQ.js index 515a6f5..cdceb27 100644 --- a/assets/api_mp_math_utils.md.DaaoR634.js +++ b/assets/api_mp_math_utils.md.mUQ56HGQ.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},t=n(`

mbcp.mp_math.utils

说明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

说明: 区间限定函数

参数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源代码
python
def clamp(x: float, min_: float, max_: float) -> float:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),t={name:"api/mp_math/utils.md"},l=n(`

mbcp.mp_math.utils

说明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

说明: 区间限定函数

参数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源代码

在GitHub上查看

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -9,8 +9,8 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源代码
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

源代码
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源代码

在GitHub上查看

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

源代码

在GitHub上查看

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -20,9 +20,9 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

源代码
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

说明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

参数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源代码
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

源代码

在GitHub上查看

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

def __ne__(self, other)

源代码

在GitHub上查看

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

说明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

参数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -32,7 +32,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

说明: 获取数的符号。

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

说明: 获取数的符号。

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码

在GitHub上查看

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -45,7 +45,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

说明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

说明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

参数:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源代码

在GitHub上查看

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -61,4 +61,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return f'-{abs(x)}'
     else:
-        return ''
`,35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; + return ''
`,35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/api_mp_math_utils.md.mUQ56HGQ.lean.js b/assets/api_mp_math_utils.md.mUQ56HGQ.lean.js new file mode 100644 index 0000000..cfe527c --- /dev/null +++ b/assets/api_mp_math_utils.md.mUQ56HGQ.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),t={name:"api/mp_math/utils.md"},l=n("",35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/api_mp_math_vector.md.BTnPeAKR.lean.js b/assets/api_mp_math_vector.md.BTnPeAKR.lean.js deleted file mode 100644 index 43fec61..0000000 --- a/assets/api_mp_math_vector.md.BTnPeAKR.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"zh/api/mp_math/vector.md"}'),t={name:"api/mp_math/vector.md"},l=n("",127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; diff --git a/assets/api_mp_math_vector.md.BTnPeAKR.js b/assets/api_mp_math_vector.md.BeAN7TkI.js similarity index 77% rename from assets/api_mp_math_vector.md.BTnPeAKR.js rename to assets/api_mp_math_vector.md.BeAN7TkI.js index a376927..18b47a2 100644 --- a/assets/api_mp_math_vector.md.BTnPeAKR.js +++ b/assets/api_mp_math_vector.md.BeAN7TkI.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"zh/api/mp_math/vector.md"}'),t={name:"api/mp_math/vector.md"},l=n(`

mbcp.mp_math.vector

说明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

说明: 3维向量

参数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源代码
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"zh/api/mp_math/vector.md"}'),n={name:"api/mp_math/vector.md"},e=t(`

mbcp.mp_math.vector

说明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

说明: 3维向量

参数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源代码

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似相等。

参数:

  • other:
  • epsilon:

返回: 是否近似相等

源代码

在GitHub上查看

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -18,7 +18,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

说明: 计算两个向量之间的夹角。

参数:

  • other: 另一个向量

返回: 夹角

源代码
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

说明: 计算两个向量之间的夹角。

参数:

  • other: 另一个向量

返回: 夹角

源代码

在GitHub上查看

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -26,7 +26,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

说明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

参数:

  • other:

返回: 行列式的结果

源代码
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

说明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

参数:

  • other:

返回: 行列式的结果

源代码

在GitHub上查看

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -46,7 +46,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似平行。

参数:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源代码
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

说明: 判断两个向量是否近似平行。

参数:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源代码

在GitHub上查看

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -55,7 +55,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

说明: 判断两个向量是否平行。

参数:

  • other: 另一个向量

返回: 是否平行

源代码
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

说明: 判断两个向量是否平行。

参数:

  • other: 另一个向量

返回: 是否平行

源代码

在GitHub上查看

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

说明: 将向量归一化。

自体归一化,不返回值。

源代码
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

说明: 将向量归一化。

自体归一化,不返回值。

源代码

在GitHub上查看

python
def normalize(self):
     """
         将向量归一化。
 
@@ -72,32 +72,32 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

源代码
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

源代码

在GitHub上查看

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

说明: 向量的模。

返回: 模

源代码
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

说明: 向量的模。

返回: 模

源代码

在GitHub上查看

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

说明: 获取该向量的单位向量。

返回: 单位向量

源代码
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

说明: 获取该向量的单位向量。

返回: 单位向量

源代码

在GitHub上查看

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

源代码
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

源代码
python
@overload
+    return self / self.length

def __abs__(self)

源代码

在GitHub上查看

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

说明: V + P -> P

V + V -> V

参数:

  • other:
源代码
python
def __add__(self, other):
+    ...

def self + other

说明: V + P -> P

V + V -> V

参数:

  • other:
源代码

在GitHub上查看

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -112,7 +112,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

说明: 判断两个向量是否相等。

参数:

  • other:

返回: 是否相等

源代码
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

说明: 判断两个向量是否相等。

参数:

  • other:

返回: 是否相等

源代码

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -120,7 +120,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

说明: P + V -> P

别去点那边实现了。 :param other: :return:

源代码
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

说明: P + V -> P

别去点那边实现了。 :param other: :return:

源代码

在GitHub上查看

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -128,11 +128,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源代码
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

源代码
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

源代码

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

说明: V - P -> P

V - V -> V

参数:

  • other:
源代码
python
def __sub__(self, other):
+    ...

def self - other

说明: V - P -> P

V - V -> V

参数:

  • other:
源代码

在GitHub上查看

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

说明: P - V -> P

参数:

  • other:
源代码
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

说明: P - V -> P

参数:

  • other:
源代码

在GitHub上查看

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -157,11 +157,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源代码
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源代码

在GitHub上查看

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

源代码
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

源代码

在GitHub上查看

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

说明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

参数:

  • other:
源代码
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

说明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

参数:

  • other:
源代码

在GitHub上查看

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -174,14 +174,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源代码
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

说明: 点乘。

参数:

  • other:
源代码
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源代码

在GitHub上查看

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

说明: 点乘。

参数:

  • other:
源代码

在GitHub上查看

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

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

var zero_vector3 = Vector3(0, 0, 0)

  • 类型: Vector3

  • 说明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 类型: Vector3

  • 说明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 类型: Vector3

  • 说明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 类型: Vector3

  • 说明: z轴单位向量

`,127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; + return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

源代码

在GitHub上查看

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

def - self

源代码

在GitHub上查看

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

var zero_vector3 = Vector3(0, 0, 0)

  • 类型: Vector3

  • 说明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 类型: Vector3

  • 说明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 类型: Vector3

  • 说明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 类型: Vector3

  • 说明: z轴单位向量

`,127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/api_mp_math_vector.md.BeAN7TkI.lean.js b/assets/api_mp_math_vector.md.BeAN7TkI.lean.js new file mode 100644 index 0000000..898e5c6 --- /dev/null +++ b/assets/api_mp_math_vector.md.BeAN7TkI.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"zh/api/mp_math/vector.md"}'),n={name:"api/mp_math/vector.md"},e=t("",127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/api_presets_model_index.md.gO0Notp6.js b/assets/api_presets_model_index.md.BGeoOSCd.js similarity index 92% rename from assets/api_presets_model_index.md.gO0Notp6.js rename to assets/api_presets_model_index.md.BGeoOSCd.js index 6293b88..e1d9744 100644 --- a/assets/api_presets_model_index.md.gO0Notp6.js +++ b/assets/api_presets_model_index.md.BGeoOSCd.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n(`

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n(`

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/api_presets_model_index.md.gO0Notp6.lean.js b/assets/api_presets_model_index.md.BGeoOSCd.lean.js similarity index 64% rename from assets/api_presets_model_index.md.gO0Notp6.lean.js rename to assets/api_presets_model_index.md.BGeoOSCd.lean.js index fdc554c..f7f315d 100644 --- a/assets/api_presets_model_index.md.gO0Notp6.lean.js +++ b/assets/api_presets_model_index.md.BGeoOSCd.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/api_presets_model_model.md.s8f68j_n.js b/assets/api_presets_model_model.md.D34eFRNH.js similarity index 92% rename from assets/api_presets_model_model.md.s8f68j_n.js rename to assets/api_presets_model_model.md.D34eFRNH.js index 549692f..42d6e85 100644 --- a/assets/api_presets_model_model.md.s8f68j_n.js +++ b/assets/api_presets_model_model.md.D34eFRNH.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/model.md","filePath":"zh/api/presets/model/model.md"}'),t={name:"api/presets/model/model.md"},h=n(`

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/model.md","filePath":"zh/api/presets/model/model.md"}'),t={name:"api/presets/model/model.md"},h=n(`

mbcp.presets.model

说明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

说明: 生成球体上的点集。

参数:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源代码

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/api_presets_model_model.md.s8f68j_n.lean.js b/assets/api_presets_model_model.md.D34eFRNH.lean.js similarity index 77% rename from assets/api_presets_model_model.md.s8f68j_n.lean.js rename to assets/api_presets_model_model.md.D34eFRNH.lean.js index d72c0d9..7aba8e4 100644 --- a/assets/api_presets_model_model.md.s8f68j_n.lean.js +++ b/assets/api_presets_model_model.md.D34eFRNH.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/model.md","filePath":"zh/api/presets/model/model.md"}'),t={name:"api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/model.md","filePath":"zh/api/presets/model/model.md"}'),t={name:"api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/en_api_mp_math_angle.md.Bu07wjnV.js b/assets/en_api_mp_math_angle.md.Cj4ayIet.js similarity index 74% rename from assets/en_api_mp_math_angle.md.Bu07wjnV.js rename to assets/en_api_mp_math_angle.md.Cj4ayIet.js index 3965a1b..72307f9 100644 --- a/assets/en_api_mp_math_angle.md.Bu07wjnV.js +++ b/assets/en_api_mp_math_angle.md.Cj4ayIet.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"en/api/mp_math/angle.md","filePath":"en/api/mp_math/angle.md"}'),e={name:"en/api/mp_math/angle.md"},t=n(`

mbcp.mp_math.angle

Description: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

Description: 任意角度。

Arguments:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
Source code
python
def __init__(self, value: float, is_radian: bool=False):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"en/api/mp_math/angle.md","filePath":"en/api/mp_math/angle.md"}'),e={name:"en/api/mp_math/angle.md"},t=n(`

mbcp.mp_math.angle

Description: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

Description: 任意角度。

Arguments:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
Source code

View on GitHub

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -8,92 +8,92 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

Description: 余角:两角的和为90°。

Return: 余角

Source code
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

Description: 余角:两角的和为90°。

Return: 余角

Source code

View on GitHub

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

Description: 补角:两角的和为180°。

Return: 补角

Source code
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

Description: 补角:两角的和为180°。

Return: 补角

Source code

View on GitHub

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

Description: 角度。

Return: 弧度

Source code
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

Description: 角度。

Return: 弧度

Source code

View on GitHub

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

Description: 最小正角。

Return: 最小正角度

Source code
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

Description: 最小正角。

Return: 最小正角度

Source code

View on GitHub

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

Description: 最大负角。

Return: 最大负角度

Source code
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

Description: 最大负角。

Return: 最大负角度

Source code

View on GitHub

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

Description: 正弦值。

Return: 正弦值

Source code
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

Description: 正弦值。

Return: 正弦值

Source code

View on GitHub

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

Description: 余弦值。

Return: 余弦值

Source code
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

Description: 余弦值。

Return: 余弦值

Source code

View on GitHub

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

Description: 正切值。

Return: 正切值

Source code
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

Description: 正切值。

Return: 正切值

Source code

View on GitHub

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

Description: 余切值。

Return: 余切值

Source code
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

Description: 余切值。

Return: 余切值

Source code

View on GitHub

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

Description: 正割值。

Return: 正割值

Source code
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

Description: 正割值。

Return: 正割值

Source code

View on GitHub

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

Description: 余割值。

Return: 余割值

Source code
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

Description: 余割值。

Return: 余割值

Source code

View on GitHub

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

Source code
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

Source code
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

Source code
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

Source code
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

Source code

View on GitHub

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

Source code

View on GitHub

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

Source code

View on GitHub

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

Source code

View on GitHub

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

Source code

View on GitHub

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

Source code
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

Source code

View on GitHub

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

Source code
python
def __truediv__(self, other):
+    ...

def self / other

Source code

View on GitHub

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
     return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[t];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(e,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/en_api_mp_math_angle.md.Bu07wjnV.lean.js b/assets/en_api_mp_math_angle.md.Cj4ayIet.lean.js similarity index 100% rename from assets/en_api_mp_math_angle.md.Bu07wjnV.lean.js rename to assets/en_api_mp_math_angle.md.Cj4ayIet.lean.js diff --git a/assets/en_api_mp_math_equation.md.vEMIOITc.js b/assets/en_api_mp_math_equation.md.BihILJCI.js similarity index 83% rename from assets/en_api_mp_math_equation.md.vEMIOITc.js rename to assets/en_api_mp_math_equation.md.BihILJCI.js index ed2589f..8e387dc 100644 --- a/assets/en_api_mp_math_equation.md.vEMIOITc.js +++ b/assets/en_api_mp_math_equation.md.BihILJCI.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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(`

mbcp.mp_math.equation

Description: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),t={name:"en/api/mp_math/equation.md"},l=n(`

mbcp.mp_math.equation

Description: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code

View on GitHub

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:

Return: 目标点

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

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

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:

Return: 目标点

Source code

View on GitHub

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = 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:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

Arguments:

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

Return: 偏导函数

Raises:

  • ValueError 无效变量类型
Source code

View on GitHub

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')
`,23),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}; + raise ValueError('Invalid var type')
`,23),p=[l];function h(e,k,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/en_api_mp_math_equation.md.vEMIOITc.lean.js b/assets/en_api_mp_math_equation.md.BihILJCI.lean.js similarity index 60% rename from assets/en_api_mp_math_equation.md.vEMIOITc.lean.js rename to assets/en_api_mp_math_equation.md.BihILJCI.lean.js index 82ba99e..8ef4e88 100644 --- a/assets/en_api_mp_math_equation.md.vEMIOITc.lean.js +++ b/assets/en_api_mp_math_equation.md.BihILJCI.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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("",23),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}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"en/api/mp_math/equation.md","filePath":"en/api/mp_math/equation.md"}'),t={name:"en/api/mp_math/equation.md"},l=n("",23),p=[l];function h(e,k,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/en_api_mp_math_function.md.BWhqj_9Y.js b/assets/en_api_mp_math_function.md.BR29hv60.js similarity index 95% rename from assets/en_api_mp_math_function.md.BWhqj_9Y.js rename to assets/en_api_mp_math_function.md.BR29hv60.js index 0f9eb80..05b2227 100644 --- a/assets/en_api_mp_math_function.md.BWhqj_9Y.js +++ b/assets/en_api_mp_math_function.md.BR29hv60.js @@ -1,4 +1,4 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),e={name:"en/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

Description: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

Description: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

Arguments:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

Return: 梯度

Source code
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),e={name:"en/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

Description: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

Description: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),o=[d],k=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

Arguments:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

Return: 梯度

Source code

View on GitHub

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -17,7 +17,7 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

Arguments:

  • func: 函数
  • *args: 参数

Return: 柯里化后的函数

Examples:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
Source code
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
Source code

View on GitHub

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -39,4 +39,4 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     def curried_func(*args2: Var) -> Var:
         """@litedoc-hide"""
         return func(*args, *args2)
-    return curried_func
`,13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; + return curried_func
`,13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,o)),k]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/en_api_mp_math_function.md.BWhqj_9Y.lean.js b/assets/en_api_mp_math_function.md.BR29hv60.lean.js similarity index 95% rename from assets/en_api_mp_math_function.md.BWhqj_9Y.lean.js rename to assets/en_api_mp_math_function.md.BR29hv60.lean.js index fe66848..d78993f 100644 --- a/assets/en_api_mp_math_function.md.BWhqj_9Y.lean.js +++ b/assets/en_api_mp_math_function.md.BR29hv60.lean.js @@ -1 +1 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),e={name:"en/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; +import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),e={name:"en/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),o=[d],k=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,o)),k]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/en_api_mp_math_line.md.BGq09mco.js b/assets/en_api_mp_math_line.md.CIOnk8LF.js similarity index 78% rename from assets/en_api_mp_math_line.md.BGq09mco.js rename to assets/en_api_mp_math_line.md.CIOnk8LF.js index c6d7568..bec7cdc 100644 --- a/assets/en_api_mp_math_line.md.BGq09mco.js +++ b/assets/en_api_mp_math_line.md.CIOnk8LF.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"en/api/mp_math/line.md","filePath":"en/api/mp_math/line.md"}'),l={name:"en/api/mp_math/line.md"},t=n(`

mbcp.mp_math.line

Description: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

Description: 三维空间中的直线。由一个点和一个方向向量确定。

Arguments:

  • point: 直线上的一点
  • direction: 直线的方向向量
Source code
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"en/api/mp_math/line.md","filePath":"en/api/mp_math/line.md"}'),t={name:"en/api/mp_math/line.md"},l=n(`

mbcp.mp_math.line

Description: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

Description: 三维空间中的直线。由一个点和一个方向向量确定。

Arguments:

  • point: 直线上的一点
  • direction: 直线的方向向量
Source code

View on GitHub

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -6,7 +6,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

Description: 判断两条直线是否近似相等。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似相等

Source code
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

Description: 判断两条直线是否近似相等。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

Description: 计算直线和直线之间的夹角。

Arguments:

  • other: 另一条直线

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

Description: 计算直线和直线之间的夹角。

Arguments:

  • other: 另一条直线

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -25,7 +25,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

Description: 计算直线和直线或点之间的距离。

Arguments:

  • other: 平行直线或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

Description: 计算直线和直线或点之间的距离。

Arguments:

  • other: 平行直线或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

Description: 计算两条直线的交点。

Arguments:

  • other: 另一条直线

Return: 交点

Raises:

  • ValueError 直线平行
  • ValueError 直线不共面
Source code
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

Description: 计算两条直线的交点。

Arguments:

  • other: 另一条直线

Return: 交点

Raises:

  • ValueError 直线平行
  • ValueError 直线不共面
Source code

View on GitHub

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

Description: 计算直线经过指定点p的垂线。

Arguments:

  • point: 指定点

Return: 垂线

Source code
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

Description: 计算直线经过指定点p的垂线。

Arguments:

  • point: 指定点

Return: 垂线

Source code

View on GitHub

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -71,7 +71,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

Description: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

Arguments:

  • t: 参数t

Return: 点

Source code
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

Description: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

Arguments:

  • t: 参数t

Return: 点

Source code

View on GitHub

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -79,13 +79,13 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

Description: 获取直线的参数方程。

Return: x(t), y(t), z(t)

Source code
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

Description: 获取直线的参数方程。

Return: x(t), y(t), z(t)

Source code

View on GitHub

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

Description: 判断两条直线是否近似平行。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似平行

Source code
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

Description: 判断两条直线是否近似平行。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似平行

Source code

View on GitHub

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -94,7 +94,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

Description: 判断两条直线是否平行。

Arguments:

  • other: 另一条直线

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

Description: 判断两条直线是否平行。

Arguments:

  • other: 另一条直线

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -102,7 +102,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

Description: 判断两条直线是否共线。

Arguments:

  • other: 另一条直线

Return: 是否共线

Source code
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

Description: 判断两条直线是否共线。

Arguments:

  • other: 另一条直线

Return: 是否共线

Source code

View on GitHub

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -110,7 +110,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

Description: 判断点是否在直线上。

Arguments:

  • point: 点

Return: 是否在直线上

Source code
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

Description: 判断点是否在直线上。

Arguments:

  • point: 点

Return: 是否在直线上

Source code

View on GitHub

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -118,7 +118,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

Description: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

Arguments:

  • other: 另一条直线

Return: 是否共面

Source code
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

Description: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

Arguments:

  • other: 另一条直线

Return: 是否共面

Source code

View on GitHub

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -127,7 +127,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

Description: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

Source code
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

Description: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

Source code

View on GitHub

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -140,7 +140,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

Description: 工厂函数 由两点构造直线。

Arguments:

  • p1: 点1
  • p2: 点2

Return: 直线

Source code
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

Description: 工厂函数 由两点构造直线。

Arguments:

  • p1: 点1
  • p2: 点2

Return: 直线

Source code

View on GitHub

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -151,7 +151,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

Description: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

Arguments:

  • other: 另一条直线

Return: 交点

Source code
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

Description: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

Arguments:

  • other: 另一条直线

Return: 交点

Source code

View on GitHub

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -164,7 +164,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

Description: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

Arguments:

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

def __eq__(self, other) -> bool

Description: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

Arguments:

  • other:
Source code

View on GitHub

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -175,4 +175,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),e=[t];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const c=s(l,[["render",p]]);export{E as __pageData,c as default}; + return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const c=s(t,[["render",p]]);export{E as __pageData,c as default}; diff --git a/assets/en_api_mp_math_line.md.BGq09mco.lean.js b/assets/en_api_mp_math_line.md.CIOnk8LF.lean.js similarity index 58% rename from assets/en_api_mp_math_line.md.BGq09mco.lean.js rename to assets/en_api_mp_math_line.md.CIOnk8LF.lean.js index 9841c6a..1ac2e38 100644 --- a/assets/en_api_mp_math_line.md.BGq09mco.lean.js +++ b/assets/en_api_mp_math_line.md.CIOnk8LF.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"en/api/mp_math/line.md","filePath":"en/api/mp_math/line.md"}'),l={name:"en/api/mp_math/line.md"},t=n("",107),e=[t];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const c=s(l,[["render",p]]);export{E as __pageData,c as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"en/api/mp_math/line.md","filePath":"en/api/mp_math/line.md"}'),t={name:"en/api/mp_math/line.md"},l=n("",107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const c=s(t,[["render",p]]);export{E as __pageData,c as default}; diff --git a/assets/en_api_mp_math_plane.md.C3KPGKE4.js b/assets/en_api_mp_math_plane.md.Cbmy4F0P.js similarity index 83% rename from assets/en_api_mp_math_plane.md.C3KPGKE4.js rename to assets/en_api_mp_math_plane.md.Cbmy4F0P.js index 5a2f8ed..1b061b3 100644 --- a/assets/en_api_mp_math_plane.md.C3KPGKE4.js +++ b/assets/en_api_mp_math_plane.md.Cbmy4F0P.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"en/api/mp_math/plane.md","filePath":"en/api/mp_math/plane.md"}'),l={name:"en/api/mp_math/plane.md"},t=n(`

mbcp.mp_math.plane

Description: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

Description: 平面方程:ax + by + cz + d = 0

Arguments:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
Source code
python
def __init__(self, a: float, b: float, c: float, d: float):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"en/api/mp_math/plane.md","filePath":"en/api/mp_math/plane.md"}'),l={name:"en/api/mp_math/plane.md"},t=n(`

mbcp.mp_math.plane

Description: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

Description: 平面方程:ax + by + cz + d = 0

Arguments:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
Source code

View on GitHub

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -10,7 +10,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

Description: 判断两个平面是否近似相等。

Arguments:

  • other: 另一个平面

Return: 是否近似相等

Source code
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

Description: 判断两个平面是否近似相等。

Arguments:

  • other: 另一个平面

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -28,7 +28,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

Description: 计算平面与平面之间的夹角。

Arguments:

  • other: 另一个平面

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

Description: 计算平面与平面之间的夹角。

Arguments:

  • other: 另一个平面

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -43,7 +43,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

Description: 计算平面与平面或点之间的距离。

Arguments:

  • other: 另一个平面或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

Description: 计算平面与平面或点之间的距离。

Arguments:

  • other: 另一个平面或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

Description: 计算两平面的交线。

Arguments:

  • other: 另一个平面

Return: 两平面的交线

Source code
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

Description: 计算两平面的交线。

Arguments:

  • other: 另一个平面

Return: 两平面的交线

Source code

View on GitHub

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -83,7 +83,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

Description: 计算平面与直线的交点。

Arguments:

  • other: 不与平面平行或在平面上的直线

Return: 交点

Raises:

  • ValueError 平面与直线平行或重合
Source code
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

Description: 计算平面与直线的交点。

Arguments:

  • other: 不与平面平行或在平面上的直线

Return: 交点

Raises:

  • ValueError 平面与直线平行或重合
Source code

View on GitHub

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -97,7 +97,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

Description: 计算平行于该平面且过指定点的平面。

Arguments:

  • point: 指定点

Return: 所求平面

Source code
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

Description: 计算平行于该平面且过指定点的平面。

Arguments:

  • point: 指定点

Return: 所求平面

Source code

View on GitHub

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -105,7 +105,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

Description: 判断两个平面是否平行。

Arguments:

  • other: 另一个平面

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

Description: 判断两个平面是否平行。

Arguments:

  • other: 另一个平面

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -113,14 +113,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

Description: 平面的法向量。

Return: 法向量

Source code
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

Description: 平面的法向量。

Return: 法向量

Source code

View on GitHub

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

Description: 工厂函数 由点和法向量构造平面(点法式构造)。

Arguments:

  • point: 平面上的一点
  • normal: 法向量

Return: 平面

Source code
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

Description: 工厂函数 由点和法向量构造平面(点法式构造)。

Arguments:

  • point: 平面上的一点
  • normal: 法向量

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -132,7 +132,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

Description: 工厂函数 由三点构造平面。

Arguments:

  • p1: 点1
  • p2: 点2
  • p3: 点3

Return: 平面

Source code
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

Description: 工厂函数 由三点构造平面。

Arguments:

  • p1: 点1
  • p2: 点2
  • p3: 点3

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

Description: 工厂函数 由两直线构造平面。

Arguments:

  • l1: 直线1
  • l2: 直线2

Return: 平面

Source code
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

Description: 工厂函数 由两直线构造平面。

Arguments:

  • l1: 直线1
  • l2: 直线2

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -160,7 +160,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

Description: 工厂函数 由点和直线构造平面。

Arguments:

  • point: 面上一点
  • line: 面上直线,不包含点

Return: 平面

Source code
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

Description: 工厂函数 由点和直线构造平面。

Arguments:

  • point: 面上一点
  • line: 面上直线,不包含点

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -170,11 +170,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

Source code
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

Source code

View on GitHub

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

Source code
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

Source code

View on GitHub

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

Description: 取两平面的交集(人话:交线)

Arguments:

  • other:

Return: 不平行平面的交线,平面平行返回None

Source code
python
def __and__(self, other):
+    ...

def __and__(self, other)

Description: 取两平面的交集(人话:交线)

Arguments:

  • other:

Return: 不平行平面的交线,平面平行返回None

Source code

View on GitHub

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -191,6 +191,6 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

Source code
python
def __rand__(self, other: 'Line3') -> 'Point3':
-    return self.cal_intersection_point3(other)
`,105),h=[t];function p(k,e,r,d,E,o){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; + raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

Source code

View on GitHub

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

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

Source code

View on GitHub

python
def __rand__(self, other: 'Line3') -> 'Point3':
+    return self.cal_intersection_point3(other)
`,105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/en_api_mp_math_plane.md.C3KPGKE4.lean.js b/assets/en_api_mp_math_plane.md.Cbmy4F0P.lean.js similarity index 54% rename from assets/en_api_mp_math_plane.md.C3KPGKE4.lean.js rename to assets/en_api_mp_math_plane.md.Cbmy4F0P.lean.js index 7a6f73a..7e30177 100644 --- a/assets/en_api_mp_math_plane.md.C3KPGKE4.lean.js +++ b/assets/en_api_mp_math_plane.md.Cbmy4F0P.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"en/api/mp_math/plane.md","filePath":"en/api/mp_math/plane.md"}'),l={name:"en/api/mp_math/plane.md"},t=n("",105),h=[t];function p(k,e,r,d,E,o){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"en/api/mp_math/plane.md","filePath":"en/api/mp_math/plane.md"}'),l={name:"en/api/mp_math/plane.md"},t=n("",105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/en_api_mp_math_point.md.D7ZdR7VM.js b/assets/en_api_mp_math_point.md.szYqVNff.js similarity index 74% rename from assets/en_api_mp_math_point.md.D7ZdR7VM.js rename to assets/en_api_mp_math_point.md.szYqVNff.js index 60064a4..6275184 100644 --- a/assets/en_api_mp_math_point.md.D7ZdR7VM.js +++ b/assets/en_api_mp_math_point.md.szYqVNff.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),n={name:"en/api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

Description: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

Description: 笛卡尔坐标系中的点。

Arguments:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
Source code
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),n={name:"en/api/mp_math/point.md"},e=t(`

mbcp.mp_math.point

Description: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

Description: 笛卡尔坐标系中的点。

Arguments:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
Source code

View on GitHub

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

Description: 判断两个点是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

Description: 判断两个点是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -18,11 +18,11 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

Source code
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

Description: P + V -> P P + P -> P

Arguments:

  • other:
Source code
python
def __add__(self, other):
+    ...

def self + other

Description: P + V -> P P + P -> P

Arguments:

  • other:
Source code

View on GitHub

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -30,14 +30,14 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

Description: 判断两个点是否相等。

Arguments:

  • other:
Source code
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

Description: 判断两个点是否相等。

Arguments:

  • other:
Source code

View on GitHub

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

Description: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

Arguments:

  • other:
Source code
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

Description: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

Arguments:

  • other:
Source code

View on GitHub

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -48,4 +48,4 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
 
         """
     from .vector import Vector3
-    return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),e=[l];function h(p,k,o,r,d,E){return a(),i("div",null,e)}const c=s(n,[["render",h]]);export{y as __pageData,c as default}; + return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const y=s(n,[["render",h]]);export{c as __pageData,y as default}; diff --git a/assets/en_api_mp_math_point.md.D7ZdR7VM.lean.js b/assets/en_api_mp_math_point.md.szYqVNff.lean.js similarity index 55% rename from assets/en_api_mp_math_point.md.D7ZdR7VM.lean.js rename to assets/en_api_mp_math_point.md.szYqVNff.lean.js index 8b54859..a35f932 100644 --- a/assets/en_api_mp_math_point.md.D7ZdR7VM.lean.js +++ b/assets/en_api_mp_math_point.md.szYqVNff.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),n={name:"en/api/mp_math/point.md"},l=t("",36),e=[l];function h(p,k,o,r,d,E){return a(),i("div",null,e)}const c=s(n,[["render",h]]);export{y as __pageData,c as default}; +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),n={name:"en/api/mp_math/point.md"},e=t("",36),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const y=s(n,[["render",h]]);export{c as __pageData,y as default}; diff --git a/assets/en_api_mp_math_segment.md.DMW-YUfw.js b/assets/en_api_mp_math_segment.md.CqlcAra1.js similarity index 85% rename from assets/en_api_mp_math_segment.md.DMW-YUfw.js rename to assets/en_api_mp_math_segment.md.CqlcAra1.js index bc304eb..e98d50b 100644 --- a/assets/en_api_mp_math_segment.md.DMW-YUfw.js +++ b/assets/en_api_mp_math_segment.md.CqlcAra1.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),t={name:"en/api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

Description: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

Description: 三维空间中的线段。 :param p1: :param p2:

Source code
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),t={name:"en/api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

Description: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

Description: 三维空间中的线段。 :param p1: :param p2:

Source code

View on GitHub

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
diff --git a/assets/en_api_mp_math_segment.md.DMW-YUfw.lean.js b/assets/en_api_mp_math_segment.md.CqlcAra1.lean.js
similarity index 100%
rename from assets/en_api_mp_math_segment.md.DMW-YUfw.lean.js
rename to assets/en_api_mp_math_segment.md.CqlcAra1.lean.js
diff --git a/assets/en_api_mp_math_utils.md.B3i5gz_2.lean.js b/assets/en_api_mp_math_utils.md.B3i5gz_2.lean.js
deleted file mode 100644
index d363c07..0000000
--- a/assets/en_api_mp_math_utils.md.B3i5gz_2.lean.js
+++ /dev/null
@@ -1 +0,0 @@
-import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),l={name:"en/api/mp_math/utils.md"},t=n("",35),h=[t];function e(p,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",e]]);export{E as __pageData,y as default};
diff --git a/assets/en_api_mp_math_utils.md.B3i5gz_2.js b/assets/en_api_mp_math_utils.md.CigCGgjm.js
similarity index 72%
rename from assets/en_api_mp_math_utils.md.B3i5gz_2.js
rename to assets/en_api_mp_math_utils.md.CigCGgjm.js
index 1bf53b6..8ac33cc 100644
--- a/assets/en_api_mp_math_utils.md.B3i5gz_2.js
+++ b/assets/en_api_mp_math_utils.md.CigCGgjm.js
@@ -1,4 +1,4 @@
-import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),l={name:"en/api/mp_math/utils.md"},t=n(`

mbcp.mp_math.utils

Description: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

Description: 区间限定函数

Arguments:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

Return: 限制后的值

Source code
python
def clamp(x: float, min_: float, max_: float) -> float:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),t={name:"en/api/mp_math/utils.md"},l=n(`

mbcp.mp_math.utils

Description: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

Description: 区间限定函数

Arguments:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

Return: 限制后的值

Source code

View on GitHub

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -9,8 +9,8 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

Source code
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

Source code
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

Source code

View on GitHub

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

Source code

View on GitHub

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -20,9 +20,9 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def 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)}')

def __ne__(self, other)

Source code
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

Description: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

Arguments:

  • x: 数1
  • y: 数2
  • epsilon: 误差

Return: 是否近似相等

Source code
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

Source code

View on GitHub

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

def __ne__(self, other)

Source code

View on GitHub

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

Description: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

Arguments:

  • x: 数1
  • y: 数2
  • epsilon: 误差

Return: 是否近似相等

Source code

View on GitHub

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -32,7 +32,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

Description: 获取数的符号。

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

Description: 获取数的符号。

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code

View on GitHub

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -45,7 +45,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

Description: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

Description: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code

View on GitHub

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -61,4 +61,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return f'-{abs(x)}'
     else:
-        return ''
`,35),h=[t];function e(p,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; + return ''
`,35),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",e]]);export{F as __pageData,E as default}; diff --git a/assets/en_api_mp_math_utils.md.CigCGgjm.lean.js b/assets/en_api_mp_math_utils.md.CigCGgjm.lean.js new file mode 100644 index 0000000..96881eb --- /dev/null +++ b/assets/en_api_mp_math_utils.md.CigCGgjm.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),t={name:"en/api/mp_math/utils.md"},l=n("",35),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",e]]);export{F as __pageData,E as default}; diff --git a/assets/en_api_mp_math_vector.md.CgtIoM4A.js b/assets/en_api_mp_math_vector.md.CF4kCv-W.js similarity index 78% rename from assets/en_api_mp_math_vector.md.CgtIoM4A.js rename to assets/en_api_mp_math_vector.md.CF4kCv-W.js index a4afb99..084e25b 100644 --- a/assets/en_api_mp_math_vector.md.CgtIoM4A.js +++ b/assets/en_api_mp_math_vector.md.CF4kCv-W.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"en/api/mp_math/vector.md","filePath":"en/api/mp_math/vector.md"}'),t={name:"en/api/mp_math/vector.md"},e=n(`

mbcp.mp_math.vector

Description: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

Description: 3维向量

Arguments:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
Source code
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"en/api/mp_math/vector.md","filePath":"en/api/mp_math/vector.md"}'),n={name:"en/api/mp_math/vector.md"},e=t(`

mbcp.mp_math.vector

Description: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

Description: 3维向量

Arguments:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
Source code

View on GitHub

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -18,7 +18,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

Description: 计算两个向量之间的夹角。

Arguments:

  • other: 另一个向量

Return: 夹角

Source code
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

Description: 计算两个向量之间的夹角。

Arguments:

  • other: 另一个向量

Return: 夹角

Source code

View on GitHub

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -26,7 +26,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

Description: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

Arguments:

  • other:

Return: 行列式的结果

Source code
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

Description: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

Arguments:

  • other:

Return: 行列式的结果

Source code

View on GitHub

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -46,7 +46,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似平行。

Arguments:

  • other: 另一个向量
  • epsilon: 允许的误差

Return: 是否近似平行

Source code
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似平行。

Arguments:

  • other: 另一个向量
  • epsilon: 允许的误差

Return: 是否近似平行

Source code

View on GitHub

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -55,7 +55,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

Description: 判断两个向量是否平行。

Arguments:

  • other: 另一个向量

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

Description: 判断两个向量是否平行。

Arguments:

  • other: 另一个向量

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

Description: 将向量归一化。

自体归一化,不返回值。

Source code
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

Description: 将向量归一化。

自体归一化,不返回值。

Source code

View on GitHub

python
def normalize(self):
     """
         将向量归一化。
 
@@ -72,32 +72,32 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

Source code
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

Source code

View on GitHub

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

Description: 向量的模。

Return: 模

Source code
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

Description: 向量的模。

Return: 模

Source code

View on GitHub

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

Description: 获取该向量的单位向量。

Return: 单位向量

Source code
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

Description: 获取该向量的单位向量。

Return: 单位向量

Source code

View on GitHub

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

Source code
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

Source code
python
@overload
+    return self / self.length

def __abs__(self)

Source code

View on GitHub

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

Description: V + P -> P

V + V -> V

Arguments:

  • other:
Source code
python
def __add__(self, other):
+    ...

def self + other

Description: V + P -> P

V + V -> V

Arguments:

  • other:
Source code

View on GitHub

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -112,7 +112,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

Description: 判断两个向量是否相等。

Arguments:

  • other:

Return: 是否相等

Source code
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

Description: 判断两个向量是否相等。

Arguments:

  • other:

Return: 是否相等

Source code

View on GitHub

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -120,7 +120,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

Description: P + V -> P

别去点那边实现了。 :param other: :return:

Source code
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

Description: P + V -> P

别去点那边实现了。 :param other: :return:

Source code

View on GitHub

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -128,11 +128,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

Source code
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

Description: V - P -> P

V - V -> V

Arguments:

  • other:
Source code
python
def __sub__(self, other):
+    ...

def self - other

Description: V - P -> P

V - V -> V

Arguments:

  • other:
Source code

View on GitHub

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

Description: P - V -> P

Arguments:

  • other:
Source code
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

Description: P - V -> P

Arguments:

  • other:
Source code

View on GitHub

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -157,11 +157,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

Source code
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

Source code
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

Source code

View on GitHub

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

Description: 数组运算 非点乘。点乘使用@,叉乘使用cross。

Arguments:

  • other:
Source code
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

Description: 数组运算 非点乘。点乘使用@,叉乘使用cross。

Arguments:

  • other:
Source code

View on GitHub

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -174,14 +174,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

Source code
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

Description: 点乘。

Arguments:

  • other:
Source code
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

Source code

View on GitHub

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

Description: 点乘。

Arguments:

  • other:
Source code

View on GitHub

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

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

var zero_vector3 = Vector3(0, 0, 0)

  • Type: Vector3

  • Description: 零向量

var x_axis = Vector3(1, 0, 0)

  • Type: Vector3

  • Description: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • Type: Vector3

  • Description: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • Type: Vector3

  • Description: z轴单位向量

`,127),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{y as __pageData,F as default}; + return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

Source code

View on GitHub

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

def - self

Source code

View on GitHub

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

var zero_vector3 = Vector3(0, 0, 0)

  • Type: Vector3

  • Description: 零向量

var x_axis = Vector3(1, 0, 0)

  • Type: Vector3

  • Description: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • Type: Vector3

  • Description: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • Type: Vector3

  • Description: z轴单位向量

`,127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const y=s(n,[["render",l]]);export{c as __pageData,y as default}; diff --git a/assets/en_api_mp_math_vector.md.CF4kCv-W.lean.js b/assets/en_api_mp_math_vector.md.CF4kCv-W.lean.js new file mode 100644 index 0000000..a464194 --- /dev/null +++ b/assets/en_api_mp_math_vector.md.CF4kCv-W.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"en/api/mp_math/vector.md","filePath":"en/api/mp_math/vector.md"}'),n={name:"en/api/mp_math/vector.md"},e=t("",127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const y=s(n,[["render",l]]);export{c as __pageData,y as default}; diff --git a/assets/en_api_mp_math_vector.md.CgtIoM4A.lean.js b/assets/en_api_mp_math_vector.md.CgtIoM4A.lean.js deleted file mode 100644 index 041914c..0000000 --- a/assets/en_api_mp_math_vector.md.CgtIoM4A.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"en/api/mp_math/vector.md","filePath":"en/api/mp_math/vector.md"}'),t={name:"en/api/mp_math/vector.md"},e=n("",127),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{y as __pageData,F as default}; diff --git a/assets/en_api_presets_model_index.md.pbEu-669.js b/assets/en_api_presets_model_index.md.Cnn4t_P0.js similarity index 93% rename from assets/en_api_presets_model_index.md.pbEu-669.js rename to assets/en_api_presets_model_index.md.Cnn4t_P0.js index 7409381..4aaf0fb 100644 --- a/assets/en_api_presets_model_index.md.pbEu-669.js +++ b/assets/en_api_presets_model_index.md.Cnn4t_P0.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),t={name:"en/api/presets/model/index.md"},h=n(`

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),t={name:"en/api/presets/model/index.md"},h=n(`

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code

View on GitHub

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(e,k,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/en_api_presets_model_index.md.pbEu-669.lean.js b/assets/en_api_presets_model_index.md.Cnn4t_P0.lean.js similarity index 87% rename from assets/en_api_presets_model_index.md.pbEu-669.lean.js rename to assets/en_api_presets_model_index.md.Cnn4t_P0.lean.js index 38a796b..59631d6 100644 --- a/assets/en_api_presets_model_index.md.pbEu-669.lean.js +++ b/assets/en_api_presets_model_index.md.Cnn4t_P0.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),t={name:"en/api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),t={name:"en/api/presets/model/index.md"},h=n("",10),l=[h];function p(e,k,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/en_api_presets_model_model.md.CL5uKZbj.js b/assets/en_api_presets_model_model.md.BZpQe5Li.js similarity index 93% rename from assets/en_api_presets_model_model.md.CL5uKZbj.js rename to assets/en_api_presets_model_model.md.BZpQe5Li.js index a34f6e3..c6b4fb9 100644 --- a/assets/en_api_presets_model_model.md.CL5uKZbj.js +++ b/assets/en_api_presets_model_model.md.BZpQe5Li.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/model.md","filePath":"en/api/presets/model/model.md"}'),t={name:"en/api/presets/model/model.md"},h=n(`

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/model.md","filePath":"en/api/presets/model/model.md"}'),t={name:"en/api/presets/model/model.md"},h=n(`

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code

View on GitHub

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(e,k,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/en_api_presets_model_model.md.CL5uKZbj.lean.js b/assets/en_api_presets_model_model.md.BZpQe5Li.lean.js similarity index 87% rename from assets/en_api_presets_model_model.md.CL5uKZbj.lean.js rename to assets/en_api_presets_model_model.md.BZpQe5Li.lean.js index fd83d90..1ccaf57 100644 --- a/assets/en_api_presets_model_model.md.CL5uKZbj.lean.js +++ b/assets/en_api_presets_model_model.md.BZpQe5Li.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/model.md","filePath":"en/api/presets/model/model.md"}'),t={name:"en/api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/model.md","filePath":"en/api/presets/model/model.md"}'),t={name:"en/api/presets/model/model.md"},h=n("",10),l=[h];function p(e,k,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_mp_math_angle.md.DTK1PNuJ.js b/assets/ja_api_mp_math_angle.md.D0ChdV9L.js similarity index 74% rename from assets/ja_api_mp_math_angle.md.DTK1PNuJ.js rename to assets/ja_api_mp_math_angle.md.D0ChdV9L.js index 3a65e80..c36a3bd 100644 --- a/assets/ja_api_mp_math_angle.md.DTK1PNuJ.js +++ b/assets/ja_api_mp_math_angle.md.D0ChdV9L.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),t={name:"ja/api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

引数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
ソースコード
python
def __init__(self, value: float, is_radian: bool=False):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),t={name:"ja/api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

引数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
ソースコード

GitHubで表示

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -8,92 +8,92 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

戻り値: 余角

ソースコード
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

戻り値: 余角

ソースコード

GitHubで表示

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

戻り値: 补角

ソースコード
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

戻り値: 补角

ソースコード

GitHubで表示

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

戻り値: 弧度

ソースコード
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

戻り値: 弧度

ソースコード

GitHubで表示

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

戻り値: 最小正角度

ソースコード
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

戻り値: 最小正角度

ソースコード

GitHubで表示

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

戻り値: 最大负角度

ソースコード
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

戻り値: 最大负角度

ソースコード

GitHubで表示

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

戻り値: 正弦值

ソースコード
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

戻り値: 正弦值

ソースコード

GitHubで表示

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

戻り値: 余弦值

ソースコード
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

戻り値: 余弦值

ソースコード

GitHubで表示

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

戻り値: 正切值

ソースコード
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

戻り値: 正切值

ソースコード

GitHubで表示

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

戻り値: 余切值

ソースコード
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

戻り値: 余切值

ソースコード

GitHubで表示

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

戻り値: 正割值

ソースコード
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

戻り値: 正割值

ソースコード

GitHubで表示

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

戻り値: 余割值

ソースコード
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

戻り値: 余割值

ソースコード

GitHubで表示

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

ソースコード
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

ソースコード
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

ソースコード
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

ソースコード
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

ソースコード

GitHubで表示

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

ソースコード

GitHubで表示

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

ソースコード

GitHubで表示

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

ソースコード

GitHubで表示

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

ソースコード

GitHubで表示

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

ソースコード
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

ソースコード

GitHubで表示

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

ソースコード
python
def __truediv__(self, other):
+    ...

def self / other

ソースコード

GitHubで表示

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
-    return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; + return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_angle.md.DTK1PNuJ.lean.js b/assets/ja_api_mp_math_angle.md.D0ChdV9L.lean.js similarity index 68% rename from assets/ja_api_mp_math_angle.md.DTK1PNuJ.lean.js rename to assets/ja_api_mp_math_angle.md.D0ChdV9L.lean.js index c63a8a6..3538fd3 100644 --- a/assets/ja_api_mp_math_angle.md.DTK1PNuJ.lean.js +++ b/assets/ja_api_mp_math_angle.md.D0ChdV9L.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),t={name:"ja/api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),t={name:"ja/api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_equation.md.D-4BBsnQ.lean.js b/assets/ja_api_mp_math_equation.md.D-4BBsnQ.lean.js deleted file mode 100644 index ef497b8..0000000 --- a/assets/ja_api_mp_math_equation.md.D-4BBsnQ.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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("",23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; diff --git a/assets/ja_api_mp_math_equation.md.D-4BBsnQ.js b/assets/ja_api_mp_math_equation.md.ksLzfPHD.js similarity index 83% rename from assets/ja_api_mp_math_equation.md.D-4BBsnQ.js rename to assets/ja_api_mp_math_equation.md.ksLzfPHD.js index 77b7043..7b2b292 100644 --- a/assets/ja_api_mp_math_equation.md.D-4BBsnQ.js +++ b/assets/ja_api_mp_math_equation.md.ksLzfPHD.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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(`

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),t={name:"ja/api/mp_math/equation.md"},l=n(`

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード

GitHubで表示

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:

戻り値: 目标点

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

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

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:

戻り値: 目标点

ソースコード

GitHubで表示

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

引数:

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

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

引数:

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

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード

GitHubで表示

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')
`,23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; + raise ValueError('Invalid var type')
`,23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_equation.md.ksLzfPHD.lean.js b/assets/ja_api_mp_math_equation.md.ksLzfPHD.lean.js new file mode 100644 index 0000000..de13a1e --- /dev/null +++ b/assets/ja_api_mp_math_equation.md.ksLzfPHD.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/equation.md","filePath":"ja/api/mp_math/equation.md"}'),t={name:"ja/api/mp_math/equation.md"},l=n("",23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_function.md.Bvf1U09A.js b/assets/ja_api_mp_math_function.md.S4mlhSEl.js similarity index 96% rename from assets/ja_api_mp_math_function.md.Bvf1U09A.js rename to assets/ja_api_mp_math_function.md.S4mlhSEl.js index 5283988..e0fd9ea 100644 --- a/assets/ja_api_mp_math_function.md.Bvf1U09A.js +++ b/assets/ja_api_mp_math_function.md.S4mlhSEl.js @@ -1,4 +1,4 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),e={name:"ja/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

引数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

戻り値: 梯度

ソースコード
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),e={name:"ja/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

引数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

戻り値: 梯度

ソースコード

GitHubで表示

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -17,7 +17,7 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

引数:

  • func: 函数
  • *args: 参数

戻り値: 柯里化后的函数

:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
ソースコード
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
ソースコード

GitHubで表示

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -39,4 +39,4 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     def curried_func(*args2: Var) -> Var:
         """@litedoc-hide"""
         return func(*args, *args2)
-    return curried_func
`,13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; + return curried_func
`,13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/ja_api_mp_math_function.md.Bvf1U09A.lean.js b/assets/ja_api_mp_math_function.md.S4mlhSEl.lean.js similarity index 98% rename from assets/ja_api_mp_math_function.md.Bvf1U09A.lean.js rename to assets/ja_api_mp_math_function.md.S4mlhSEl.lean.js index a55a3f5..d7023b9 100644 --- a/assets/ja_api_mp_math_function.md.Bvf1U09A.lean.js +++ b/assets/ja_api_mp_math_function.md.S4mlhSEl.lean.js @@ -1 +1 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),e={name:"ja/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; +import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),e={name:"ja/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/ja_api_mp_math_line.md.DYJV4KNE.js b/assets/ja_api_mp_math_line.md.C6_h0EEF.js similarity index 78% rename from assets/ja_api_mp_math_line.md.DYJV4KNE.js rename to assets/ja_api_mp_math_line.md.C6_h0EEF.js index 6782857..8527533 100644 --- a/assets/ja_api_mp_math_line.md.DYJV4KNE.js +++ b/assets/ja_api_mp_math_line.md.C6_h0EEF.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/line.md","filePath":"ja/api/mp_math/line.md"}'),l={name:"ja/api/mp_math/line.md"},t=n(`

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

引数:

  • point: 直线上的一点
  • direction: 直线的方向向量
ソースコード
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/line.md","filePath":"ja/api/mp_math/line.md"}'),t={name:"ja/api/mp_math/line.md"},l=n(`

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

引数:

  • point: 直线上的一点
  • direction: 直线的方向向量
ソースコード

GitHubで表示

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -6,7 +6,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

引数:

  • other: 另一条直线

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

引数:

  • other: 另一条直线

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -25,7 +25,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

引数:

  • other: 平行直线或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

引数:

  • other: 平行直线或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

引数:

  • other: 另一条直线

戻り値: 交点

例外:

  • ValueError 直线平行
  • ValueError 直线不共面
ソースコード
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

引数:

  • other: 另一条直线

戻り値: 交点

例外:

  • ValueError 直线平行
  • ValueError 直线不共面
ソースコード

GitHubで表示

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

引数:

  • point: 指定点

戻り値: 垂线

ソースコード
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

引数:

  • point: 指定点

戻り値: 垂线

ソースコード

GitHubで表示

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -71,7 +71,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

引数:

  • t: 参数t

戻り値: 点

ソースコード
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

引数:

  • t: 参数t

戻り値: 点

ソースコード

GitHubで表示

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -79,13 +79,13 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

戻り値: x(t), y(t), z(t)

ソースコード
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

戻り値: x(t), y(t), z(t)

ソースコード

GitHubで表示

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似平行

ソースコード
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似平行

ソースコード

GitHubで表示

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -94,7 +94,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

引数:

  • other: 另一条直线

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

引数:

  • other: 另一条直线

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -102,7 +102,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

引数:

  • other: 另一条直线

戻り値: 是否共线

ソースコード
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

引数:

  • other: 另一条直线

戻り値: 是否共线

ソースコード

GitHubで表示

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -110,7 +110,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

引数:

  • point: 点

戻り値: 是否在直线上

ソースコード
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

引数:

  • point: 点

戻り値: 是否在直线上

ソースコード

GitHubで表示

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -118,7 +118,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

引数:

  • other: 另一条直线

戻り値: 是否共面

ソースコード
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

引数:

  • other: 另一条直线

戻り値: 是否共面

ソースコード

GitHubで表示

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -127,7 +127,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

ソースコード
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

ソースコード

GitHubで表示

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -140,7 +140,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

引数:

  • p1: 点1
  • p2: 点2

戻り値: 直线

ソースコード
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

引数:

  • p1: 点1
  • p2: 点2

戻り値: 直线

ソースコード

GitHubで表示

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -151,7 +151,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

引数:

  • other: 另一条直线

戻り値: 交点

ソースコード
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

引数:

  • other: 另一条直线

戻り値: 交点

ソースコード

GitHubで表示

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -164,7 +164,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

引数:

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

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

引数:

  • other:
ソースコード

GitHubで表示

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -175,4 +175,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; + return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/ja_api_mp_math_line.md.DYJV4KNE.lean.js b/assets/ja_api_mp_math_line.md.C6_h0EEF.lean.js similarity index 58% rename from assets/ja_api_mp_math_line.md.DYJV4KNE.lean.js rename to assets/ja_api_mp_math_line.md.C6_h0EEF.lean.js index 5fb9a23..9fdd967 100644 --- a/assets/ja_api_mp_math_line.md.DYJV4KNE.lean.js +++ b/assets/ja_api_mp_math_line.md.C6_h0EEF.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/line.md","filePath":"ja/api/mp_math/line.md"}'),l={name:"ja/api/mp_math/line.md"},t=n("",107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/line.md","filePath":"ja/api/mp_math/line.md"}'),t={name:"ja/api/mp_math/line.md"},l=n("",107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/ja_api_mp_math_plane.md.D-yHaxP-.js b/assets/ja_api_mp_math_plane.md.CVfLX9sr.js similarity index 83% rename from assets/ja_api_mp_math_plane.md.D-yHaxP-.js rename to assets/ja_api_mp_math_plane.md.CVfLX9sr.js index 9872d64..a474967 100644 --- a/assets/ja_api_mp_math_plane.md.D-yHaxP-.js +++ b/assets/ja_api_mp_math_plane.md.CVfLX9sr.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/plane.md","filePath":"ja/api/mp_math/plane.md"}'),l={name:"ja/api/mp_math/plane.md"},h=n(`

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

引数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
ソースコード
python
def __init__(self, a: float, b: float, c: float, d: float):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/plane.md","filePath":"ja/api/mp_math/plane.md"}'),l={name:"ja/api/mp_math/plane.md"},t=n(`

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

引数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
ソースコード

GitHubで表示

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -10,7 +10,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

引数:

  • other: 另一个平面

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

引数:

  • other: 另一个平面

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -28,7 +28,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

引数:

  • other: 另一个平面

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

引数:

  • other: 另一个平面

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -43,7 +43,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

引数:

  • other: 另一个平面或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

引数:

  • other: 另一个平面或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

引数:

  • other: 另一个平面

戻り値: 两平面的交线

ソースコード
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

引数:

  • other: 另一个平面

戻り値: 两平面的交线

ソースコード

GitHubで表示

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -83,7 +83,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

引数:

  • other: 不与平面平行或在平面上的直线

戻り値: 交点

例外:

  • ValueError 平面与直线平行或重合
ソースコード
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

引数:

  • other: 不与平面平行或在平面上的直线

戻り値: 交点

例外:

  • ValueError 平面与直线平行或重合
ソースコード

GitHubで表示

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -97,7 +97,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

引数:

  • point: 指定点

戻り値: 所求平面

ソースコード
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

引数:

  • point: 指定点

戻り値: 所求平面

ソースコード

GitHubで表示

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -105,7 +105,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

引数:

  • other: 另一个平面

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

引数:

  • other: 另一个平面

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -113,14 +113,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

戻り値: 法向量

ソースコード
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

戻り値: 法向量

ソースコード

GitHubで表示

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

引数:

  • point: 平面上的一点
  • normal: 法向量

戻り値: 平面

ソースコード
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

引数:

  • point: 平面上的一点
  • normal: 法向量

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -132,7 +132,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

引数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

戻り値: 平面

ソースコード
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

引数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

引数:

  • l1: 直线1
  • l2: 直线2

戻り値: 平面

ソースコード
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

引数:

  • l1: 直线1
  • l2: 直线2

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -160,7 +160,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

引数:

  • point: 面上一点
  • line: 面上直线,不包含点

戻り値: 平面

ソースコード
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

引数:

  • point: 面上一点
  • line: 面上直线,不包含点

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -170,11 +170,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

ソースコード
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

ソースコード

GitHubで表示

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

ソースコード
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

ソースコード

GitHubで表示

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

引数:

  • other:

戻り値: 不平行平面的交线,平面平行返回None

ソースコード
python
def __and__(self, other):
+    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

引数:

  • other:

戻り値: 不平行平面的交线,平面平行返回None

ソースコード

GitHubで表示

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -191,6 +191,6 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

ソースコード
python
def __rand__(self, other: 'Line3') -> 'Point3':
-    return self.cal_intersection_point3(other)
`,105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; + raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

ソースコード

GitHubで表示

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

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

ソースコード

GitHubで表示

python
def __rand__(self, other: 'Line3') -> 'Point3':
+    return self.cal_intersection_point3(other)
`,105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_plane.md.D-yHaxP-.lean.js b/assets/ja_api_mp_math_plane.md.CVfLX9sr.lean.js similarity index 54% rename from assets/ja_api_mp_math_plane.md.D-yHaxP-.lean.js rename to assets/ja_api_mp_math_plane.md.CVfLX9sr.lean.js index 8761d16..820a56b 100644 --- a/assets/ja_api_mp_math_plane.md.D-yHaxP-.lean.js +++ b/assets/ja_api_mp_math_plane.md.CVfLX9sr.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/plane.md","filePath":"ja/api/mp_math/plane.md"}'),l={name:"ja/api/mp_math/plane.md"},h=n("",105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/plane.md","filePath":"ja/api/mp_math/plane.md"}'),l={name:"ja/api/mp_math/plane.md"},t=n("",105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_point.md.DjHRkHI5.js b/assets/ja_api_mp_math_point.md.21gM893G.js similarity index 73% rename from assets/ja_api_mp_math_point.md.DjHRkHI5.js rename to assets/ja_api_mp_math_point.md.21gM893G.js index b9735ff..e168eff 100644 --- a/assets/ja_api_mp_math_point.md.DjHRkHI5.js +++ b/assets/ja_api_mp_math_point.md.21gM893G.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),n={name:"ja/api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

引数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
ソースコード
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),n={name:"ja/api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

引数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
ソースコード

GitHubで表示

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -18,11 +18,11 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

ソースコード
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: P + V -> P P + P -> P

引数:

  • other:
ソースコード
python
def __add__(self, other):
+    ...

def self + other

説明: P + V -> P P + P -> P

引数:

  • other:
ソースコード

GitHubで表示

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -30,14 +30,14 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

引数:

  • other:
ソースコード
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

引数:

  • other:
ソースコード

GitHubで表示

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

引数:

  • other:
ソースコード
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

引数:

  • other:
ソースコード

GitHubで表示

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -48,4 +48,4 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
 
         """
     from .vector import Vector3
-    return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; + return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_mp_math_point.md.DjHRkHI5.lean.js b/assets/ja_api_mp_math_point.md.21gM893G.lean.js similarity index 68% rename from assets/ja_api_mp_math_point.md.DjHRkHI5.lean.js rename to assets/ja_api_mp_math_point.md.21gM893G.lean.js index 83beb8b..7aec043 100644 --- a/assets/ja_api_mp_math_point.md.DjHRkHI5.lean.js +++ b/assets/ja_api_mp_math_point.md.21gM893G.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),n={name:"ja/api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),n={name:"ja/api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_mp_math_segment.md.37V8kAc1.js b/assets/ja_api_mp_math_segment.md.Dji9_vOI.js similarity index 83% rename from assets/ja_api_mp_math_segment.md.37V8kAc1.js rename to assets/ja_api_mp_math_segment.md.Dji9_vOI.js index 2a61ac7..b278320 100644 --- a/assets/ja_api_mp_math_segment.md.37V8kAc1.js +++ b/assets/ja_api_mp_math_segment.md.Dji9_vOI.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),t={name:"ja/api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

ソースコード
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),t={name:"ja/api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

ソースコード

GitHubで表示

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -11,4 +11,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     '长度'
     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)
`,6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; + self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2)
`,6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/ja_api_mp_math_segment.md.37V8kAc1.lean.js b/assets/ja_api_mp_math_segment.md.Dji9_vOI.lean.js similarity index 59% rename from assets/ja_api_mp_math_segment.md.37V8kAc1.lean.js rename to assets/ja_api_mp_math_segment.md.Dji9_vOI.lean.js index 399c379..5673767 100644 --- a/assets/ja_api_mp_math_segment.md.37V8kAc1.lean.js +++ b/assets/ja_api_mp_math_segment.md.Dji9_vOI.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),t={name:"ja/api/mp_math/segment.md"},p=n("",6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),t={name:"ja/api/mp_math/segment.md"},p=n("",6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/ja_api_mp_math_utils.md.BbdhM1tp.lean.js b/assets/ja_api_mp_math_utils.md.BbdhM1tp.lean.js deleted file mode 100644 index f674376..0000000 --- a/assets/ja_api_mp_math_utils.md.BbdhM1tp.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},t=n("",35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/ja_api_mp_math_utils.md.BbdhM1tp.js b/assets/ja_api_mp_math_utils.md.DhvjDskn.js similarity index 72% rename from assets/ja_api_mp_math_utils.md.BbdhM1tp.js rename to assets/ja_api_mp_math_utils.md.DhvjDskn.js index 7c674b7..b982d37 100644 --- a/assets/ja_api_mp_math_utils.md.BbdhM1tp.js +++ b/assets/ja_api_mp_math_utils.md.DhvjDskn.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},t=n(`

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

引数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

戻り値: 限制后的值

ソースコード
python
def clamp(x: float, min_: float, max_: float) -> float:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),t={name:"ja/api/mp_math/utils.md"},l=n(`

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

引数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

戻り値: 限制后的值

ソースコード

GitHubで表示

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -9,8 +9,8 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

ソースコード
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

ソースコード
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

ソースコード

GitHubで表示

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

ソースコード

GitHubで表示

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -20,9 +20,9 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

ソースコード
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

引数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

ソースコード

GitHubで表示

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

def __ne__(self, other)

ソースコード

GitHubで表示

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

引数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -32,7 +32,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード

GitHubで表示

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -45,7 +45,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード

GitHubで表示

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -61,4 +61,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return f'-{abs(x)}'
     else:
-        return ''
`,35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; + return ''
`,35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/ja_api_mp_math_utils.md.DhvjDskn.lean.js b/assets/ja_api_mp_math_utils.md.DhvjDskn.lean.js new file mode 100644 index 0000000..a33e8ec --- /dev/null +++ b/assets/ja_api_mp_math_utils.md.DhvjDskn.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),t={name:"ja/api/mp_math/utils.md"},l=n("",35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/ja_api_mp_math_vector.md.BBVnCwJa.lean.js b/assets/ja_api_mp_math_vector.md.BBVnCwJa.lean.js deleted file mode 100644 index 1e17985..0000000 --- a/assets/ja_api_mp_math_vector.md.BBVnCwJa.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/vector.md","filePath":"ja/api/mp_math/vector.md"}'),t={name:"ja/api/mp_math/vector.md"},l=n("",127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; diff --git a/assets/ja_api_mp_math_vector.md.BBVnCwJa.js b/assets/ja_api_mp_math_vector.md.DyGgurm4.js similarity index 76% rename from assets/ja_api_mp_math_vector.md.BBVnCwJa.js rename to assets/ja_api_mp_math_vector.md.DyGgurm4.js index 386905a..628ee91 100644 --- a/assets/ja_api_mp_math_vector.md.BBVnCwJa.js +++ b/assets/ja_api_mp_math_vector.md.DyGgurm4.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/vector.md","filePath":"ja/api/mp_math/vector.md"}'),t={name:"ja/api/mp_math/vector.md"},l=n(`

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

引数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
ソースコード
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/vector.md","filePath":"ja/api/mp_math/vector.md"}'),n={name:"ja/api/mp_math/vector.md"},e=t(`

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

引数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
ソースコード

GitHubで表示

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -18,7 +18,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

引数:

  • other: 另一个向量

戻り値: 夹角

ソースコード
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

引数:

  • other: 另一个向量

戻り値: 夹角

ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -26,7 +26,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

引数:

  • other:

戻り値: 行列式的结果

ソースコード
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

引数:

  • other:

戻り値: 行列式的结果

ソースコード

GitHubで表示

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -46,7 +46,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

引数:

  • other: 另一个向量
  • epsilon: 允许的误差

戻り値: 是否近似平行

ソースコード
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

引数:

  • other: 另一个向量
  • epsilon: 允许的误差

戻り値: 是否近似平行

ソースコード

GitHubで表示

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -55,7 +55,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

引数:

  • other: 另一个向量

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

引数:

  • other: 另一个向量

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

ソースコード
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

ソースコード

GitHubで表示

python
def normalize(self):
     """
         将向量归一化。
 
@@ -72,32 +72,32 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

ソースコード
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

ソースコード

GitHubで表示

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

戻り値: 模

ソースコード
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

戻り値: 模

ソースコード

GitHubで表示

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

戻り値: 单位向量

ソースコード
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

戻り値: 单位向量

ソースコード

GitHubで表示

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

ソースコード
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

ソースコード
python
@overload
+    return self / self.length

def __abs__(self)

ソースコード

GitHubで表示

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: V + P -> P

V + V -> V

引数:

  • other:
ソースコード
python
def __add__(self, other):
+    ...

def self + other

説明: V + P -> P

V + V -> V

引数:

  • other:
ソースコード

GitHubで表示

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -112,7 +112,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

引数:

  • other:

戻り値: 是否相等

ソースコード
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

引数:

  • other:

戻り値: 是否相等

ソースコード

GitHubで表示

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -120,7 +120,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

ソースコード
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

ソースコード

GitHubで表示

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -128,11 +128,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

ソースコード
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

説明: V - P -> P

V - V -> V

引数:

  • other:
ソースコード
python
def __sub__(self, other):
+    ...

def self - other

説明: V - P -> P

V - V -> V

引数:

  • other:
ソースコード

GitHubで表示

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

引数:

  • other:
ソースコード
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

引数:

  • other:
ソースコード

GitHubで表示

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -157,11 +157,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

ソースコード
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

ソースコード
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

ソースコード

GitHubで表示

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

引数:

  • other:
ソースコード
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

引数:

  • other:
ソースコード

GitHubで表示

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -174,14 +174,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

ソースコード
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

引数:

  • other:
ソースコード
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

ソースコード

GitHubで表示

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

引数:

  • other:
ソースコード

GitHubで表示

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

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

var zero_vector3 = Vector3(0, 0, 0)

  • タイプ: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • タイプ: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • タイプ: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • タイプ: Vector3

  • 説明: z轴单位向量

`,127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; + return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

ソースコード

GitHubで表示

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

def - self

ソースコード

GitHubで表示

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

var zero_vector3 = Vector3(0, 0, 0)

  • タイプ: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • タイプ: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • タイプ: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • タイプ: Vector3

  • 説明: z轴单位向量

`,127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_mp_math_vector.md.DyGgurm4.lean.js b/assets/ja_api_mp_math_vector.md.DyGgurm4.lean.js new file mode 100644 index 0000000..0a30939 --- /dev/null +++ b/assets/ja_api_mp_math_vector.md.DyGgurm4.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"ja/api/mp_math/vector.md","filePath":"ja/api/mp_math/vector.md"}'),n={name:"ja/api/mp_math/vector.md"},e=t("",127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_presets_model_index.md.C-Ypf-qh.js b/assets/ja_api_presets_model_index.md.Dbt3LFNK.js similarity index 92% rename from assets/ja_api_presets_model_index.md.C-Ypf-qh.js rename to assets/ja_api_presets_model_index.md.Dbt3LFNK.js index 4ff335d..8f89a3c 100644 --- a/assets/ja_api_presets_model_index.md.C-Ypf-qh.js +++ b/assets/ja_api_presets_model_index.md.Dbt3LFNK.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/index.md","filePath":"ja/api/presets/model/index.md"}'),t={name:"ja/api/presets/model/index.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/index.md","filePath":"ja/api/presets/model/index.md"}'),t={name:"ja/api/presets/model/index.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード

GitHubで表示

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_presets_model_index.md.C-Ypf-qh.lean.js b/assets/ja_api_presets_model_index.md.Dbt3LFNK.lean.js similarity index 64% rename from assets/ja_api_presets_model_index.md.C-Ypf-qh.lean.js rename to assets/ja_api_presets_model_index.md.Dbt3LFNK.lean.js index 17ebf41..691534d 100644 --- a/assets/ja_api_presets_model_index.md.C-Ypf-qh.lean.js +++ b/assets/ja_api_presets_model_index.md.Dbt3LFNK.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/index.md","filePath":"ja/api/presets/model/index.md"}'),t={name:"ja/api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/index.md","filePath":"ja/api/presets/model/index.md"}'),t={name:"ja/api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_presets_model_model.md.Dwbc1qIc.js b/assets/ja_api_presets_model_model.md.ti1HKQyY.js similarity index 92% rename from assets/ja_api_presets_model_model.md.Dwbc1qIc.js rename to assets/ja_api_presets_model_model.md.ti1HKQyY.js index 6fbd9a8..829157b 100644 --- a/assets/ja_api_presets_model_model.md.Dwbc1qIc.js +++ b/assets/ja_api_presets_model_model.md.ti1HKQyY.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/model.md","filePath":"ja/api/presets/model/model.md"}'),t={name:"ja/api/presets/model/model.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/model.md","filePath":"ja/api/presets/model/model.md"}'),t={name:"ja/api/presets/model/model.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード

GitHubで表示

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/ja_api_presets_model_model.md.Dwbc1qIc.lean.js b/assets/ja_api_presets_model_model.md.ti1HKQyY.lean.js similarity index 76% rename from assets/ja_api_presets_model_model.md.Dwbc1qIc.lean.js rename to assets/ja_api_presets_model_model.md.ti1HKQyY.lean.js index ec27df9..2b7d156 100644 --- a/assets/ja_api_presets_model_model.md.Dwbc1qIc.lean.js +++ b/assets/ja_api_presets_model_model.md.ti1HKQyY.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/model.md","filePath":"ja/api/presets/model/model.md"}'),t={name:"ja/api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"ja/api/presets/model/model.md","filePath":"ja/api/presets/model/model.md"}'),t={name:"ja/api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/style.BiH8pcAw.css b/assets/style.BiH8pcAw.css deleted file mode 100644 index 15f2f22..0000000 --- a/assets/style.BiH8pcAw.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic.C5lxZ8CY.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek-ext.CqjqNYQ-.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek.BBVDIX6e.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-vietnamese.BjW4sHH5.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin-ext.4ZJIpNVo.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin.Di8DUHzh.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic-ext.r48I6akx.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic.By2_1cv3.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek-ext.1u6EdAuj.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek.DJ8dCoTZ.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-vietnamese.BSbpV94h.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin-ext.CN1xVJS-.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin.C2AdPX0b.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Punctuation SC;font-weight:400;src:local("PingFang SC Regular"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:500;src:local("PingFang SC Medium"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:600;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:700;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}:root{--vp-c-white: #ffffff;--vp-c-black: #000000;--vp-c-neutral: var(--vp-c-black);--vp-c-neutral-inverse: var(--vp-c-white)}.dark{--vp-c-neutral: var(--vp-c-white);--vp-c-neutral-inverse: var(--vp-c-black)}:root{--vp-c-gray-1: #dddde3;--vp-c-gray-2: #e4e4e9;--vp-c-gray-3: #ebebef;--vp-c-gray-soft: rgba(142, 150, 170, .14);--vp-c-indigo-1: #3451b2;--vp-c-indigo-2: #3a5ccc;--vp-c-indigo-3: #5672cd;--vp-c-indigo-soft: rgba(100, 108, 255, .14);--vp-c-purple-1: #6f42c1;--vp-c-purple-2: #7e4cc9;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .14);--vp-c-green-1: #18794e;--vp-c-green-2: #299764;--vp-c-green-3: #30a46c;--vp-c-green-soft: rgba(16, 185, 129, .14);--vp-c-yellow-1: #915930;--vp-c-yellow-2: #946300;--vp-c-yellow-3: #9f6a00;--vp-c-yellow-soft: rgba(234, 179, 8, .14);--vp-c-red-1: #b8272c;--vp-c-red-2: #d5393e;--vp-c-red-3: #e0575b;--vp-c-red-soft: rgba(244, 63, 94, .14);--vp-c-sponsor: #db2777}.dark{--vp-c-gray-1: #515c67;--vp-c-gray-2: #414853;--vp-c-gray-3: #32363f;--vp-c-gray-soft: rgba(101, 117, 133, .16);--vp-c-indigo-1: #a8b1ff;--vp-c-indigo-2: #5c73e7;--vp-c-indigo-3: #3e63dd;--vp-c-indigo-soft: rgba(100, 108, 255, .16);--vp-c-purple-1: #c8abfa;--vp-c-purple-2: #a879e6;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .16);--vp-c-green-1: #3dd68c;--vp-c-green-2: #30a46c;--vp-c-green-3: #298459;--vp-c-green-soft: rgba(16, 185, 129, .16);--vp-c-yellow-1: #f9b44e;--vp-c-yellow-2: #da8b17;--vp-c-yellow-3: #a46a0a;--vp-c-yellow-soft: rgba(234, 179, 8, .16);--vp-c-red-1: #f66f81;--vp-c-red-2: #f14158;--vp-c-red-3: #b62a3c;--vp-c-red-soft: rgba(244, 63, 94, .16)}:root{--vp-c-bg: #ffffff;--vp-c-bg-alt: #f6f6f7;--vp-c-bg-elv: #ffffff;--vp-c-bg-soft: #f6f6f7}.dark{--vp-c-bg: #1b1b1f;--vp-c-bg-alt: #161618;--vp-c-bg-elv: #202127;--vp-c-bg-soft: #202127}:root{--vp-c-border: #c2c2c4;--vp-c-divider: #e2e2e3;--vp-c-gutter: #e2e2e3}.dark{--vp-c-border: #3c3f44;--vp-c-divider: #2e2e32;--vp-c-gutter: #000000}:root{--vp-c-text-1: rgba(60, 60, 67);--vp-c-text-2: rgba(60, 60, 67, .78);--vp-c-text-3: rgba(60, 60, 67, .56)}.dark{--vp-c-text-1: rgba(255, 255, 245, .86);--vp-c-text-2: rgba(235, 235, 245, .6);--vp-c-text-3: rgba(235, 235, 245, .38)}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-brand: var(--vp-c-brand-1);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-note-1: var(--vp-c-brand-1);--vp-c-note-2: var(--vp-c-brand-2);--vp-c-note-3: var(--vp-c-brand-3);--vp-c-note-soft: var(--vp-c-brand-soft);--vp-c-success-1: var(--vp-c-green-1);--vp-c-success-2: var(--vp-c-green-2);--vp-c-success-3: var(--vp-c-green-3);--vp-c-success-soft: var(--vp-c-green-soft);--vp-c-important-1: var(--vp-c-purple-1);--vp-c-important-2: var(--vp-c-purple-2);--vp-c-important-3: var(--vp-c-purple-3);--vp-c-important-soft: var(--vp-c-purple-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft);--vp-c-caution-1: var(--vp-c-red-1);--vp-c-caution-2: var(--vp-c-red-2);--vp-c-caution-3: var(--vp-c-red-3);--vp-c-caution-soft: var(--vp-c-red-soft)}:root{--vp-font-family-base: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--vp-font-family-mono: ui-monospace, "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}:root:where(:lang(zh)){--vp-font-family-base: "Punctuation SC", "Inter", ui-sans-serif, system-ui, "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Heiti SC", "Microsoft YaHei", "DengXian", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}:root{--vp-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--vp-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--vp-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--vp-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--vp-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)}:root{--vp-z-index-footer: 10;--vp-z-index-local-nav: 20;--vp-z-index-nav: 30;--vp-z-index-layout-top: 40;--vp-z-index-backdrop: 50;--vp-z-index-sidebar: 60}@media (min-width: 960px){:root{--vp-z-index-sidebar: 25}}:root{--vp-layout-max-width: 1440px}:root{--vp-header-anchor-symbol: "#"}:root{--vp-code-line-height: 1.7;--vp-code-font-size: .875em;--vp-code-color: var(--vp-c-brand-1);--vp-code-link-color: var(--vp-c-brand-1);--vp-code-link-hover-color: var(--vp-c-brand-2);--vp-code-bg: var(--vp-c-default-soft);--vp-code-block-color: var(--vp-c-text-2);--vp-code-block-bg: var(--vp-c-bg-alt);--vp-code-block-divider-color: var(--vp-c-gutter);--vp-code-lang-color: var(--vp-c-text-3);--vp-code-line-highlight-color: var(--vp-c-default-soft);--vp-code-line-number-color: var(--vp-c-text-3);--vp-code-line-diff-add-color: var(--vp-c-success-soft);--vp-code-line-diff-add-symbol-color: var(--vp-c-success-1);--vp-code-line-diff-remove-color: var(--vp-c-danger-soft);--vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1);--vp-code-line-warning-color: var(--vp-c-warning-soft);--vp-code-line-error-color: var(--vp-c-danger-soft);--vp-code-copy-code-border-color: var(--vp-c-divider);--vp-code-copy-code-bg: var(--vp-c-bg-soft);--vp-code-copy-code-hover-border-color: var(--vp-c-divider);--vp-code-copy-code-hover-bg: var(--vp-c-bg);--vp-code-copy-code-active-text: var(--vp-c-text-2);--vp-code-copy-copied-text-content: "Copied";--vp-code-tab-divider: var(--vp-code-block-divider-color);--vp-code-tab-text-color: var(--vp-c-text-2);--vp-code-tab-bg: var(--vp-code-block-bg);--vp-code-tab-hover-text-color: var(--vp-c-text-1);--vp-code-tab-active-text-color: var(--vp-c-text-1);--vp-code-tab-active-bar-color: var(--vp-c-brand-1)}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1);--vp-button-alt-border: transparent;--vp-button-alt-text: var(--vp-c-text-1);--vp-button-alt-bg: var(--vp-c-default-3);--vp-button-alt-hover-border: transparent;--vp-button-alt-hover-text: var(--vp-c-text-1);--vp-button-alt-hover-bg: var(--vp-c-default-2);--vp-button-alt-active-border: transparent;--vp-button-alt-active-text: var(--vp-c-text-1);--vp-button-alt-active-bg: var(--vp-c-default-1);--vp-button-sponsor-border: var(--vp-c-text-2);--vp-button-sponsor-text: var(--vp-c-text-2);--vp-button-sponsor-bg: transparent;--vp-button-sponsor-hover-border: var(--vp-c-sponsor);--vp-button-sponsor-hover-text: var(--vp-c-sponsor);--vp-button-sponsor-hover-bg: transparent;--vp-button-sponsor-active-border: var(--vp-c-sponsor);--vp-button-sponsor-active-text: var(--vp-c-sponsor);--vp-button-sponsor-active-bg: transparent}:root{--vp-custom-block-font-size: 14px;--vp-custom-block-code-font-size: 13px;--vp-custom-block-info-border: transparent;--vp-custom-block-info-text: var(--vp-c-text-1);--vp-custom-block-info-bg: var(--vp-c-default-soft);--vp-custom-block-info-code-bg: var(--vp-c-default-soft);--vp-custom-block-note-border: transparent;--vp-custom-block-note-text: var(--vp-c-text-1);--vp-custom-block-note-bg: var(--vp-c-default-soft);--vp-custom-block-note-code-bg: var(--vp-c-default-soft);--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-tip-soft);--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);--vp-custom-block-important-border: transparent;--vp-custom-block-important-text: var(--vp-c-text-1);--vp-custom-block-important-bg: var(--vp-c-important-soft);--vp-custom-block-important-code-bg: var(--vp-c-important-soft);--vp-custom-block-warning-border: transparent;--vp-custom-block-warning-text: var(--vp-c-text-1);--vp-custom-block-warning-bg: var(--vp-c-warning-soft);--vp-custom-block-warning-code-bg: var(--vp-c-warning-soft);--vp-custom-block-danger-border: transparent;--vp-custom-block-danger-text: var(--vp-c-text-1);--vp-custom-block-danger-bg: var(--vp-c-danger-soft);--vp-custom-block-danger-code-bg: var(--vp-c-danger-soft);--vp-custom-block-caution-border: transparent;--vp-custom-block-caution-text: var(--vp-c-text-1);--vp-custom-block-caution-bg: var(--vp-c-caution-soft);--vp-custom-block-caution-code-bg: var(--vp-c-caution-soft);--vp-custom-block-details-border: var(--vp-custom-block-info-border);--vp-custom-block-details-text: var(--vp-custom-block-info-text);--vp-custom-block-details-bg: var(--vp-custom-block-info-bg);--vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg)}:root{--vp-input-border-color: var(--vp-c-border);--vp-input-bg-color: var(--vp-c-bg-alt);--vp-input-switch-bg-color: var(--vp-c-default-soft)}:root{--vp-nav-height: 64px;--vp-nav-bg-color: var(--vp-c-bg);--vp-nav-screen-bg-color: var(--vp-c-bg);--vp-nav-logo-height: 24px}.hide-nav{--vp-nav-height: 0px}.hide-nav .VPSidebar{--vp-nav-height: 22px}:root{--vp-local-nav-bg-color: var(--vp-c-bg)}:root{--vp-sidebar-width: 272px;--vp-sidebar-bg-color: var(--vp-c-bg-alt)}:root{--vp-backdrop-bg-color: rgba(0, 0, 0, .6)}:root{--vp-home-hero-name-color: var(--vp-c-brand-1);--vp-home-hero-name-background: transparent;--vp-home-hero-image-background-image: none;--vp-home-hero-image-filter: none}:root{--vp-badge-info-border: transparent;--vp-badge-info-text: var(--vp-c-text-2);--vp-badge-info-bg: var(--vp-c-default-soft);--vp-badge-tip-border: transparent;--vp-badge-tip-text: var(--vp-c-tip-1);--vp-badge-tip-bg: var(--vp-c-tip-soft);--vp-badge-warning-border: transparent;--vp-badge-warning-text: var(--vp-c-warning-1);--vp-badge-warning-bg: var(--vp-c-warning-soft);--vp-badge-danger-border: transparent;--vp-badge-danger-text: var(--vp-c-danger-1);--vp-badge-danger-bg: var(--vp-c-danger-soft)}:root{--vp-carbon-ads-text-color: var(--vp-c-text-1);--vp-carbon-ads-poweredby-color: var(--vp-c-text-2);--vp-carbon-ads-bg-color: var(--vp-c-bg-soft);--vp-carbon-ads-hover-text-color: var(--vp-c-brand-1);--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1)}:root{--vp-local-search-bg: var(--vp-c-bg);--vp-local-search-result-bg: var(--vp-c-bg);--vp-local-search-result-border: var(--vp-c-divider);--vp-local-search-result-selected-bg: var(--vp-c-bg);--vp-local-search-result-selected-border: var(--vp-c-brand-1);--vp-local-search-highlight-bg: var(--vp-c-brand-1);--vp-local-search-highlight-text: var(--vp-c-neutral-inverse)}@media (prefers-reduced-motion: reduce){*,:before,:after{animation-delay:-1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important;background-attachment:initial!important;scroll-behavior:auto!important;transition-duration:0s!important;transition-delay:0s!important}}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}html.dark{color-scheme:dark}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:24px;font-family:var(--vp-font-family-base);font-size:16px;font-weight:400;color:var(--vp-c-text-1);background-color:var(--vp-c-bg);font-synthesis:style;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:24px;font-size:16px;font-weight:400}p{margin:0}strong,b{font-weight:600}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{color:inherit;text-decoration:inherit}ol,ul{list-style:none;margin:0;padding:0}blockquote{margin:0}pre,code,kbd,samp{font-family:var(--vp-font-family-mono)}img,svg,video,canvas,audio,iframe,embed,object{display:block}figure{margin:0}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{border:0;padding:0;line-height:inherit;color:inherit}button{padding:0;font-family:inherit;background-color:transparent;background-image:none}button:enabled,[role=button]:enabled{cursor:pointer}button:focus,button:focus-visible{outline:1px dotted;outline:4px auto -webkit-focus-ring-color}button:focus:not(:focus-visible){outline:none!important}input:focus,textarea:focus,select:focus{outline:none}table{border-collapse:collapse}input{background-color:transparent}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--vp-c-text-3)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--vp-c-text-3)}input::placeholder,textarea::placeholder{color:var(--vp-c-text-3)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}textarea{resize:vertical}select{-webkit-appearance:none}fieldset{margin:0;padding:0}h1,h2,h3,h4,h5,h6,li,p{overflow-wrap:break-word}vite-error-overlay{z-index:9999}mjx-container{overflow-x:auto}mjx-container>svg{display:inline-block;margin:auto}[class^=vpi-],[class*=" vpi-"],.vp-icon{width:1em;height:1em}[class^=vpi-].bg,[class*=" vpi-"].bg,.vp-icon.bg{background-size:100% 100%;background-color:transparent}[class^=vpi-]:not(.bg),[class*=" vpi-"]:not(.bg),.vp-icon:not(.bg){-webkit-mask:var(--icon) no-repeat;mask:var(--icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit}.vpi-align-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E")}.vpi-arrow-right,.vpi-arrow-down,.vpi-arrow-left,.vpi-arrow-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E")}.vpi-chevron-right,.vpi-chevron-down,.vpi-chevron-left,.vpi-chevron-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}.vpi-chevron-down,.vpi-arrow-down{transform:rotate(90deg)}.vpi-chevron-left,.vpi-arrow-left{transform:rotate(180deg)}.vpi-chevron-up,.vpi-arrow-up{transform:rotate(-90deg)}.vpi-square-pen{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E")}.vpi-plus{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E")}.vpi-sun{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E")}.vpi-moon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E")}.vpi-more-horizontal{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E")}.vpi-languages{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E")}.vpi-heart{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E")}.vpi-search{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}.vpi-layout-list{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E")}.vpi-delete{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E")}.vpi-corner-down-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E")}:root{--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E")}.vpi-social-discord{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z'/%3E%3C/svg%3E")}.vpi-social-facebook{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z'/%3E%3C/svg%3E")}.vpi-social-github{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}.vpi-social-instagram{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.03.084c-1.277.06-2.149.264-2.91.563a5.874 5.874 0 0 0-2.124 1.388 5.878 5.878 0 0 0-1.38 2.127C.321 4.926.12 5.8.064 7.076.008 8.354-.005 8.764.001 12.023c.007 3.259.021 3.667.083 4.947.061 1.277.264 2.149.563 2.911.308.789.72 1.457 1.388 2.123a5.872 5.872 0 0 0 2.129 1.38c.763.295 1.636.496 2.913.552 1.278.056 1.689.069 4.947.063 3.257-.007 3.668-.021 4.947-.082 1.28-.06 2.147-.265 2.91-.563a5.881 5.881 0 0 0 2.123-1.388 5.881 5.881 0 0 0 1.38-2.129c.295-.763.496-1.636.551-2.912.056-1.28.07-1.69.063-4.948-.006-3.258-.02-3.667-.081-4.947-.06-1.28-.264-2.148-.564-2.911a5.892 5.892 0 0 0-1.387-2.123 5.857 5.857 0 0 0-2.128-1.38C19.074.322 18.202.12 16.924.066 15.647.009 15.236-.006 11.977 0 8.718.008 8.31.021 7.03.084m.14 21.693c-1.17-.05-1.805-.245-2.228-.408a3.736 3.736 0 0 1-1.382-.895 3.695 3.695 0 0 1-.9-1.378c-.165-.423-.363-1.058-.417-2.228-.06-1.264-.072-1.644-.08-4.848-.006-3.204.006-3.583.061-4.848.05-1.169.246-1.805.408-2.228.216-.561.477-.96.895-1.382a3.705 3.705 0 0 1 1.379-.9c.423-.165 1.057-.361 2.227-.417 1.265-.06 1.644-.072 4.848-.08 3.203-.006 3.583.006 4.85.062 1.168.05 1.804.244 2.227.408.56.216.96.475 1.382.895.421.42.681.817.9 1.378.165.422.362 1.056.417 2.227.06 1.265.074 1.645.08 4.848.005 3.203-.006 3.583-.061 4.848-.051 1.17-.245 1.805-.408 2.23-.216.56-.477.96-.896 1.38a3.705 3.705 0 0 1-1.378.9c-.422.165-1.058.362-2.226.418-1.266.06-1.645.072-4.85.079-3.204.007-3.582-.006-4.848-.06m9.783-16.192a1.44 1.44 0 1 0 1.437-1.442 1.44 1.44 0 0 0-1.437 1.442M5.839 12.012a6.161 6.161 0 1 0 12.323-.024 6.162 6.162 0 0 0-12.323.024M8 12.008A4 4 0 1 1 12.008 16 4 4 0 0 1 8 12.008'/%3E%3C/svg%3E")}.vpi-social-linkedin{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E")}.vpi-social-mastodon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z'/%3E%3C/svg%3E")}.vpi-social-npm{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z'/%3E%3C/svg%3E")}.vpi-social-slack{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z'/%3E%3C/svg%3E")}.vpi-social-twitter,.vpi-social-x{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E")}.vpi-social-youtube{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E")}.visually-hidden{position:absolute;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden}.custom-block{border:1px solid transparent;border-radius:8px;padding:16px 16px 8px;line-height:24px;font-size:var(--vp-custom-block-font-size);color:var(--vp-c-text-2)}.custom-block.info{border-color:var(--vp-custom-block-info-border);color:var(--vp-custom-block-info-text);background-color:var(--vp-custom-block-info-bg)}.custom-block.info a,.custom-block.info code{color:var(--vp-c-brand-1)}.custom-block.info a:hover,.custom-block.info a:hover>code{color:var(--vp-c-brand-2)}.custom-block.info code{background-color:var(--vp-custom-block-info-code-bg)}.custom-block.note{border-color:var(--vp-custom-block-note-border);color:var(--vp-custom-block-note-text);background-color:var(--vp-custom-block-note-bg)}.custom-block.note a,.custom-block.note code{color:var(--vp-c-brand-1)}.custom-block.note a:hover,.custom-block.note a:hover>code{color:var(--vp-c-brand-2)}.custom-block.note code{background-color:var(--vp-custom-block-note-code-bg)}.custom-block.tip{border-color:var(--vp-custom-block-tip-border);color:var(--vp-custom-block-tip-text);background-color:var(--vp-custom-block-tip-bg)}.custom-block.tip a,.custom-block.tip code{color:var(--vp-c-tip-1)}.custom-block.tip a:hover,.custom-block.tip a:hover>code{color:var(--vp-c-tip-2)}.custom-block.tip code{background-color:var(--vp-custom-block-tip-code-bg)}.custom-block.important{border-color:var(--vp-custom-block-important-border);color:var(--vp-custom-block-important-text);background-color:var(--vp-custom-block-important-bg)}.custom-block.important a,.custom-block.important code{color:var(--vp-c-important-1)}.custom-block.important a:hover,.custom-block.important a:hover>code{color:var(--vp-c-important-2)}.custom-block.important code{background-color:var(--vp-custom-block-important-code-bg)}.custom-block.warning{border-color:var(--vp-custom-block-warning-border);color:var(--vp-custom-block-warning-text);background-color:var(--vp-custom-block-warning-bg)}.custom-block.warning a,.custom-block.warning code{color:var(--vp-c-warning-1)}.custom-block.warning a:hover,.custom-block.warning a:hover>code{color:var(--vp-c-warning-2)}.custom-block.warning code{background-color:var(--vp-custom-block-warning-code-bg)}.custom-block.danger{border-color:var(--vp-custom-block-danger-border);color:var(--vp-custom-block-danger-text);background-color:var(--vp-custom-block-danger-bg)}.custom-block.danger a,.custom-block.danger code{color:var(--vp-c-danger-1)}.custom-block.danger a:hover,.custom-block.danger a:hover>code{color:var(--vp-c-danger-2)}.custom-block.danger code{background-color:var(--vp-custom-block-danger-code-bg)}.custom-block.caution{border-color:var(--vp-custom-block-caution-border);color:var(--vp-custom-block-caution-text);background-color:var(--vp-custom-block-caution-bg)}.custom-block.caution a,.custom-block.caution code{color:var(--vp-c-caution-1)}.custom-block.caution a:hover,.custom-block.caution a:hover>code{color:var(--vp-c-caution-2)}.custom-block.caution code{background-color:var(--vp-custom-block-caution-code-bg)}.custom-block.details{border-color:var(--vp-custom-block-details-border);color:var(--vp-custom-block-details-text);background-color:var(--vp-custom-block-details-bg)}.custom-block.details a{color:var(--vp-c-brand-1)}.custom-block.details a:hover,.custom-block.details a:hover>code{color:var(--vp-c-brand-2)}.custom-block.details code{background-color:var(--vp-custom-block-details-code-bg)}.custom-block-title{font-weight:600}.custom-block p+p{margin:8px 0}.custom-block.details summary{margin:0 0 8px;font-weight:700;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-block.details summary+p{margin:8px 0}.custom-block a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;transition:opacity .25s}.custom-block a:hover{opacity:.75}.custom-block code{font-size:var(--vp-custom-block-code-font-size)}.custom-block.custom-block th,.custom-block.custom-block blockquote>p{font-size:var(--vp-custom-block-font-size);color:inherit}.dark .vp-code span{color:var(--shiki-dark, inherit)}html:not(.dark) .vp-code span{color:var(--shiki-light, inherit)}.vp-code-group{margin-top:16px}.vp-code-group .tabs{position:relative;display:flex;margin-right:-24px;margin-left:-24px;padding:0 12px;background-color:var(--vp-code-tab-bg);overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px var(--vp-code-tab-divider)}@media (min-width: 640px){.vp-code-group .tabs{margin-right:0;margin-left:0;border-radius:8px 8px 0 0}}.vp-code-group .tabs input{position:fixed;opacity:0;pointer-events:none}.vp-code-group .tabs label{position:relative;display:inline-block;border-bottom:1px solid transparent;padding:0 12px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-code-tab-text-color);white-space:nowrap;cursor:pointer;transition:color .25s}.vp-code-group .tabs label:after{position:absolute;right:8px;bottom:-1px;left:8px;z-index:1;height:2px;border-radius:2px;content:"";background-color:transparent;transition:background-color .25s}.vp-code-group label:hover{color:var(--vp-code-tab-hover-text-color)}.vp-code-group input:checked+label{color:var(--vp-code-tab-active-text-color)}.vp-code-group input:checked+label:after{background-color:var(--vp-code-tab-active-bar-color)}.vp-code-group div[class*=language-],.vp-block{display:none;margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.vp-code-group div[class*=language-].active,.vp-block.active{display:block}.vp-block{padding:20px 24px}.vp-doc h1,.vp-doc h2,.vp-doc h3,.vp-doc h4,.vp-doc h5,.vp-doc h6{position:relative;font-weight:600;outline:none}.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:28px}.vp-doc h2{margin:48px 0 16px;border-top:1px solid var(--vp-c-divider);padding-top:24px;letter-spacing:-.02em;line-height:32px;font-size:24px}.vp-doc h3{margin:32px 0 0;letter-spacing:-.01em;line-height:28px;font-size:20px}.vp-doc h4{margin:24px 0 0;letter-spacing:-.01em;line-height:24px;font-size:18px}.vp-doc .header-anchor{position:absolute;top:0;left:0;margin-left:-.87em;font-weight:500;-webkit-user-select:none;user-select:none;opacity:0;text-decoration:none;transition:color .25s,opacity .25s}.vp-doc .header-anchor:before{content:var(--vp-header-anchor-symbol)}.vp-doc h1:hover .header-anchor,.vp-doc h1 .header-anchor:focus,.vp-doc h2:hover .header-anchor,.vp-doc h2 .header-anchor:focus,.vp-doc h3:hover .header-anchor,.vp-doc h3 .header-anchor:focus,.vp-doc h4:hover .header-anchor,.vp-doc h4 .header-anchor:focus,.vp-doc h5:hover .header-anchor,.vp-doc h5 .header-anchor:focus,.vp-doc h6:hover .header-anchor,.vp-doc h6 .header-anchor:focus{opacity:1}@media (min-width: 768px){.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:32px}}.vp-doc h2 .header-anchor{top:24px}.vp-doc p,.vp-doc summary{margin:16px 0}.vp-doc p{line-height:28px}.vp-doc blockquote{margin:16px 0;border-left:2px solid var(--vp-c-divider);padding-left:16px;transition:border-color .5s;color:var(--vp-c-text-2)}.vp-doc blockquote>p{margin:0;font-size:16px;transition:color .5s}.vp-doc a{font-weight:500;color:var(--vp-c-brand-1);text-decoration:underline;text-underline-offset:2px;transition:color .25s,opacity .25s}.vp-doc a:hover{color:var(--vp-c-brand-2)}.vp-doc strong{font-weight:600}.vp-doc ul,.vp-doc ol{padding-left:1.25rem;margin:16px 0}.vp-doc ul{list-style:disc}.vp-doc ol{list-style:decimal}.vp-doc li+li{margin-top:8px}.vp-doc li>ol,.vp-doc li>ul{margin:8px 0 0}.vp-doc table{display:block;border-collapse:collapse;margin:20px 0;overflow-x:auto}.vp-doc tr{background-color:var(--vp-c-bg);border-top:1px solid var(--vp-c-divider);transition:background-color .5s}.vp-doc tr:nth-child(2n){background-color:var(--vp-c-bg-soft)}.vp-doc th,.vp-doc td{border:1px solid var(--vp-c-divider);padding:8px 16px}.vp-doc th{text-align:left;font-size:14px;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-doc td{font-size:14px}.vp-doc hr{margin:16px 0;border:none;border-top:1px solid var(--vp-c-divider)}.vp-doc .custom-block{margin:16px 0}.vp-doc .custom-block p{margin:8px 0;line-height:24px}.vp-doc .custom-block p:first-child{margin:0}.vp-doc .custom-block div[class*=language-]{margin:8px 0;border-radius:8px}.vp-doc .custom-block div[class*=language-] code{font-weight:400;background-color:transparent}.vp-doc .custom-block .vp-code-group .tabs{margin:0;border-radius:8px 8px 0 0}.vp-doc :not(pre,h1,h2,h3,h4,h5,h6)>code{font-size:var(--vp-code-font-size);color:var(--vp-code-color)}.vp-doc :not(pre)>code{border-radius:4px;padding:3px 6px;background-color:var(--vp-code-bg);transition:color .25s,background-color .5s}.vp-doc a>code{color:var(--vp-code-link-color)}.vp-doc a:hover>code{color:var(--vp-code-link-hover-color)}.vp-doc h1>code,.vp-doc h2>code,.vp-doc h3>code,.vp-doc h4>code{font-size:.9em}.vp-doc div[class*=language-],.vp-block{position:relative;margin:16px -24px;background-color:var(--vp-code-block-bg);overflow-x:auto;transition:background-color .5s}@media (min-width: 640px){.vp-doc div[class*=language-],.vp-block{border-radius:8px;margin:16px 0}}@media (max-width: 639px){.vp-doc li div[class*=language-]{border-radius:8px 0 0 8px}}.vp-doc div[class*=language-]+div[class*=language-],.vp-doc div[class$=-api]+div[class*=language-],.vp-doc div[class*=language-]+div[class$=-api]>div[class*=language-]{margin-top:-8px}.vp-doc [class*=language-] pre,.vp-doc [class*=language-] code{direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.vp-doc [class*=language-] pre{position:relative;z-index:1;margin:0;padding:20px 0;background:transparent;overflow-x:auto}.vp-doc [class*=language-] code{display:block;padding:0 24px;width:fit-content;min-width:100%;line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-block-color);transition:color .5s}.vp-doc [class*=language-] code .highlighted{background-color:var(--vp-code-line-highlight-color);transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .highlighted.error{background-color:var(--vp-code-line-error-color)}.vp-doc [class*=language-] code .highlighted.warning{background-color:var(--vp-code-line-warning-color)}.vp-doc [class*=language-] code .diff{transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .diff:before{position:absolute;left:10px}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){filter:blur(.095rem);opacity:.4;transition:filter .35s,opacity .35s}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){opacity:.7;transition:filter .35s,opacity .35s}.vp-doc [class*=language-]:hover .has-focused-lines .line:not(.has-focus){filter:blur(0);opacity:1}.vp-doc [class*=language-] code .diff.remove{background-color:var(--vp-code-line-diff-remove-color);opacity:.7}.vp-doc [class*=language-] code .diff.remove:before{content:"-";color:var(--vp-code-line-diff-remove-symbol-color)}.vp-doc [class*=language-] code .diff.add{background-color:var(--vp-code-line-diff-add-color)}.vp-doc [class*=language-] code .diff.add:before{content:"+";color:var(--vp-code-line-diff-add-symbol-color)}.vp-doc div[class*=language-].line-numbers-mode{padding-left:32px}.vp-doc .line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid var(--vp-code-block-divider-color);padding-top:20px;width:32px;text-align:center;font-family:var(--vp-font-family-mono);line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-line-number-color);transition:border-color .5s,color .5s}.vp-doc [class*=language-]>button.copy{direction:ltr;position:absolute;top:12px;right:12px;z-index:3;border:1px solid var(--vp-code-copy-code-border-color);border-radius:4px;width:40px;height:40px;background-color:var(--vp-code-copy-code-bg);opacity:0;cursor:pointer;background-image:var(--vp-icon-copy);background-position:50%;background-size:20px;background-repeat:no-repeat;transition:border-color .25s,background-color .25s,opacity .25s}.vp-doc [class*=language-]:hover>button.copy,.vp-doc [class*=language-]>button.copy:focus{opacity:1}.vp-doc [class*=language-]>button.copy:hover,.vp-doc [class*=language-]>button.copy.copied{border-color:var(--vp-code-copy-code-hover-border-color);background-color:var(--vp-code-copy-code-hover-bg)}.vp-doc [class*=language-]>button.copy.copied,.vp-doc [class*=language-]>button.copy:hover.copied{border-radius:0 4px 4px 0;background-color:var(--vp-code-copy-code-hover-bg);background-image:var(--vp-icon-copied)}.vp-doc [class*=language-]>button.copy.copied:before,.vp-doc [class*=language-]>button.copy:hover.copied:before{position:relative;top:-1px;transform:translate(calc(-100% - 1px));display:flex;justify-content:center;align-items:center;border:1px solid var(--vp-code-copy-code-hover-border-color);border-right:0;border-radius:4px 0 0 4px;padding:0 10px;width:fit-content;height:40px;text-align:center;font-size:12px;font-weight:500;color:var(--vp-code-copy-code-active-text);background-color:var(--vp-code-copy-code-hover-bg);white-space:nowrap;content:var(--vp-code-copy-copied-text-content)}.vp-doc [class*=language-]>span.lang{position:absolute;top:2px;right:8px;z-index:2;font-size:12px;font-weight:500;color:var(--vp-code-lang-color);transition:color .4s,opacity .4s}.vp-doc [class*=language-]:hover>button.copy+span.lang,.vp-doc [class*=language-]>button.copy:focus+span.lang{opacity:0}.vp-doc .VPTeamMembers{margin-top:24px}.vp-doc .VPTeamMembers.small.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}.vp-doc .VPTeamMembers.small.count-2 .container,.vp-doc .VPTeamMembers.small.count-3 .container{max-width:100%!important}.vp-doc .VPTeamMembers.medium.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}:is(.vp-external-link-icon,.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(.no-icon):after{display:inline-block;margin-top:-1px;margin-left:4px;width:11px;height:11px;background:currentColor;color:var(--vp-c-text-3);flex-shrink:0;--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");-webkit-mask-image:var(--icon);mask-image:var(--icon)}.vp-external-link-icon:after{content:""}.external-link-icon-enabled :is(.vp-doc a[href*="://"],.vp-doc a[target=_blank]):after{content:"";color:currentColor}.vp-sponsor{border-radius:16px;overflow:hidden}.vp-sponsor.aside{border-radius:12px}.vp-sponsor-section+.vp-sponsor-section{margin-top:4px}.vp-sponsor-tier{margin:0 0 4px!important;text-align:center;letter-spacing:1px!important;line-height:24px;width:100%;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-sponsor.normal .vp-sponsor-tier{padding:13px 0 11px;font-size:14px}.vp-sponsor.aside .vp-sponsor-tier{padding:9px 0 7px;font-size:12px}.vp-sponsor-grid+.vp-sponsor-tier{margin-top:4px}.vp-sponsor-grid{display:flex;flex-wrap:wrap;gap:4px}.vp-sponsor-grid.xmini .vp-sponsor-grid-link{height:64px}.vp-sponsor-grid.xmini .vp-sponsor-grid-image{max-width:64px;max-height:22px}.vp-sponsor-grid.mini .vp-sponsor-grid-link{height:72px}.vp-sponsor-grid.mini .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.small .vp-sponsor-grid-link{height:96px}.vp-sponsor-grid.small .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.medium .vp-sponsor-grid-link{height:112px}.vp-sponsor-grid.medium .vp-sponsor-grid-image{max-width:120px;max-height:36px}.vp-sponsor-grid.big .vp-sponsor-grid-link{height:184px}.vp-sponsor-grid.big .vp-sponsor-grid-image{max-width:192px;max-height:56px}.vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item{width:calc((100% - 4px)/2)}.vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item{width:calc((100% - 4px * 2) / 3)}.vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item{width:calc((100% - 12px)/4)}.vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item{width:calc((100% - 16px)/5)}.vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item{width:calc((100% - 4px * 5) / 6)}.vp-sponsor-grid-item{flex-shrink:0;width:100%;background-color:var(--vp-c-bg-soft);transition:background-color .25s}.vp-sponsor-grid-item:hover{background-color:var(--vp-c-default-soft)}.vp-sponsor-grid-item:hover .vp-sponsor-grid-image{filter:grayscale(0) invert(0)}.vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.dark .vp-sponsor-grid-item:hover{background-color:var(--vp-c-white)}.dark .vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.vp-sponsor-grid-link{display:flex}.vp-sponsor-grid-box{display:flex;justify-content:center;align-items:center;width:100%}.vp-sponsor-grid-image{max-width:100%;filter:grayscale(1);transition:filter .25s}.dark .vp-sponsor-grid-image{filter:grayscale(1) invert(1)}.VPBadge{display:inline-block;margin-left:2px;border:1px solid transparent;border-radius:12px;padding:0 10px;line-height:22px;font-size:12px;font-weight:500;transform:translateY(-2px)}.VPBadge.small{padding:0 6px;line-height:18px;font-size:10px;transform:translateY(-8px)}.VPDocFooter .VPBadge{display:none}.vp-doc h1>.VPBadge{margin-top:4px;vertical-align:top}.vp-doc h2>.VPBadge{margin-top:3px;padding:0 8px;vertical-align:top}.vp-doc h3>.VPBadge{vertical-align:middle}.vp-doc h4>.VPBadge,.vp-doc h5>.VPBadge,.vp-doc h6>.VPBadge{vertical-align:middle;line-height:18px}.VPBadge.info{border-color:var(--vp-badge-info-border);color:var(--vp-badge-info-text);background-color:var(--vp-badge-info-bg)}.VPBadge.tip{border-color:var(--vp-badge-tip-border);color:var(--vp-badge-tip-text);background-color:var(--vp-badge-tip-bg)}.VPBadge.warning{border-color:var(--vp-badge-warning-border);color:var(--vp-badge-warning-text);background-color:var(--vp-badge-warning-bg)}.VPBadge.danger{border-color:var(--vp-badge-danger-border);color:var(--vp-badge-danger-text);background-color:var(--vp-badge-danger-bg)}.VPBackdrop[data-v-20b1d393]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vp-z-index-backdrop);background:var(--vp-backdrop-bg-color);transition:opacity .5s}.VPBackdrop.fade-enter-from[data-v-20b1d393],.VPBackdrop.fade-leave-to[data-v-20b1d393]{opacity:0}.VPBackdrop.fade-leave-active[data-v-20b1d393]{transition-duration:.25s}@media (min-width: 1280px){.VPBackdrop[data-v-20b1d393]{display:none}}.NotFound[data-v-21980364]{padding:64px 24px 96px;text-align:center}@media (min-width: 768px){.NotFound[data-v-21980364]{padding:96px 32px 168px}}.code[data-v-21980364]{line-height:64px;font-size:64px;font-weight:600}.title[data-v-21980364]{padding-top:12px;letter-spacing:2px;line-height:20px;font-size:20px;font-weight:700}.divider[data-v-21980364]{margin:24px auto 18px;width:64px;height:1px;background-color:var(--vp-c-divider)}.quote[data-v-21980364]{margin:0 auto;max-width:256px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.action[data-v-21980364]{padding-top:20px}.link[data-v-21980364]{display:inline-block;border:1px solid var(--vp-c-brand-1);border-radius:16px;padding:3px 16px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:border-color .25s,color .25s}.link[data-v-21980364]:hover{border-color:var(--vp-c-brand-2);color:var(--vp-c-brand-2)}.root[data-v-51c2c770]{position:relative;z-index:1}.nested[data-v-51c2c770]{padding-right:16px;padding-left:16px}.outline-link[data-v-51c2c770]{display:block;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .5s}.outline-link[data-v-51c2c770]:hover,.outline-link.active[data-v-51c2c770]{color:var(--vp-c-text-1);transition:color .25s}.outline-link.nested[data-v-51c2c770]{padding-left:13px}.VPDocAsideOutline[data-v-e7b12e6e]{display:none}.VPDocAsideOutline.has-outline[data-v-e7b12e6e]{display:block}.content[data-v-e7b12e6e]{position:relative;border-left:1px solid var(--vp-c-divider);padding-left:16px;font-size:13px;font-weight:500}.outline-marker[data-v-e7b12e6e]{position:absolute;top:32px;left:-1px;z-index:0;opacity:0;width:2px;border-radius:2px;height:18px;background-color:var(--vp-c-brand-1);transition:top .25s cubic-bezier(0,1,.5,1),background-color .5s,opacity .25s}.outline-title[data-v-e7b12e6e]{line-height:32px;font-size:14px;font-weight:600}.VPDocAside[data-v-0ff3c77f]{display:flex;flex-direction:column;flex-grow:1}.spacer[data-v-0ff3c77f]{flex-grow:1}.VPDocAside[data-v-0ff3c77f] .spacer+.VPDocAsideSponsors,.VPDocAside[data-v-0ff3c77f] .spacer+.VPDocAsideCarbonAds{margin-top:24px}.VPDocAside[data-v-0ff3c77f] .VPDocAsideSponsors+.VPDocAsideCarbonAds{margin-top:16px}.VPLastUpdated[data-v-5cebc0fc]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 640px){.VPLastUpdated[data-v-5cebc0fc]{line-height:32px;font-size:14px;font-weight:500}}.VPDocFooter[data-v-a4b38bd6]{margin-top:64px}.edit-info[data-v-a4b38bd6]{padding-bottom:18px}@media (min-width: 640px){.edit-info[data-v-a4b38bd6]{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}.edit-link-button[data-v-a4b38bd6]{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.edit-link-button[data-v-a4b38bd6]:hover{color:var(--vp-c-brand-2)}.edit-link-icon[data-v-a4b38bd6]{margin-right:8px}.prev-next[data-v-a4b38bd6]{border-top:1px solid var(--vp-c-divider);padding-top:24px;display:grid;grid-row-gap:8px}@media (min-width: 640px){.prev-next[data-v-a4b38bd6]{grid-template-columns:repeat(2,1fr);grid-column-gap:16px}}.pager-link[data-v-a4b38bd6]{display:block;border:1px solid var(--vp-c-divider);border-radius:8px;padding:11px 16px 13px;width:100%;height:100%;transition:border-color .25s}.pager-link[data-v-a4b38bd6]:hover{border-color:var(--vp-c-brand-1)}.pager-link.next[data-v-a4b38bd6]{margin-left:auto;text-align:right}.desc[data-v-a4b38bd6]{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.title[data-v-a4b38bd6]{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.VPDoc[data-v-40342069]{padding:32px 24px 96px;width:100%}@media (min-width: 768px){.VPDoc[data-v-40342069]{padding:48px 32px 128px}}@media (min-width: 960px){.VPDoc[data-v-40342069]{padding:48px 32px 0}.VPDoc:not(.has-sidebar) .container[data-v-40342069]{display:flex;justify-content:center;max-width:992px}.VPDoc:not(.has-sidebar) .content[data-v-40342069]{max-width:752px}}@media (min-width: 1280px){.VPDoc .container[data-v-40342069]{display:flex;justify-content:center}.VPDoc .aside[data-v-40342069]{display:block}}@media (min-width: 1440px){.VPDoc:not(.has-sidebar) .content[data-v-40342069]{max-width:784px}.VPDoc:not(.has-sidebar) .container[data-v-40342069]{max-width:1104px}}.container[data-v-40342069]{margin:0 auto;width:100%}.aside[data-v-40342069]{position:relative;display:none;order:2;flex-grow:1;padding-left:32px;width:100%;max-width:256px}.left-aside[data-v-40342069]{order:1;padding-left:unset;padding-right:32px}.aside-container[data-v-40342069]{position:fixed;top:0;padding-top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px);width:224px;height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}.aside-container[data-v-40342069]::-webkit-scrollbar{display:none}.aside-curtain[data-v-40342069]{position:fixed;bottom:0;z-index:10;width:224px;height:32px;background:linear-gradient(transparent,var(--vp-c-bg) 70%)}.aside-content[data-v-40342069]{display:flex;flex-direction:column;min-height:calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px));padding-bottom:32px}.content[data-v-40342069]{position:relative;margin:0 auto;width:100%}@media (min-width: 960px){.content[data-v-40342069]{padding:0 32px 128px}}@media (min-width: 1280px){.content[data-v-40342069]{order:1;margin:0;min-width:640px}}.content-container[data-v-40342069]{margin:0 auto}.VPDoc.has-aside .content-container[data-v-40342069]{max-width:688px}.VPButton[data-v-885c6978]{display:inline-block;border:1px solid transparent;text-align:center;font-weight:600;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s}.VPButton[data-v-885c6978]:active{transition:color .1s,border-color .1s,background-color .1s}.VPButton.medium[data-v-885c6978]{border-radius:20px;padding:0 20px;line-height:38px;font-size:14px}.VPButton.big[data-v-885c6978]{border-radius:24px;padding:0 24px;line-height:46px;font-size:16px}.VPButton.brand[data-v-885c6978]{border-color:var(--vp-button-brand-border);color:var(--vp-button-brand-text);background-color:var(--vp-button-brand-bg)}.VPButton.brand[data-v-885c6978]:hover{border-color:var(--vp-button-brand-hover-border);color:var(--vp-button-brand-hover-text);background-color:var(--vp-button-brand-hover-bg)}.VPButton.brand[data-v-885c6978]:active{border-color:var(--vp-button-brand-active-border);color:var(--vp-button-brand-active-text);background-color:var(--vp-button-brand-active-bg)}.VPButton.alt[data-v-885c6978]{border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.VPButton.alt[data-v-885c6978]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.VPButton.alt[data-v-885c6978]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.VPButton.sponsor[data-v-885c6978]{border-color:var(--vp-button-sponsor-border);color:var(--vp-button-sponsor-text);background-color:var(--vp-button-sponsor-bg)}.VPButton.sponsor[data-v-885c6978]:hover{border-color:var(--vp-button-sponsor-hover-border);color:var(--vp-button-sponsor-hover-text);background-color:var(--vp-button-sponsor-hover-bg)}.VPButton.sponsor[data-v-885c6978]:active{border-color:var(--vp-button-sponsor-active-border);color:var(--vp-button-sponsor-active-text);background-color:var(--vp-button-sponsor-active-bg)}html:not(.dark) .VPImage.dark[data-v-f925500d]{display:none}.dark .VPImage.light[data-v-f925500d]{display:none}.VPHero[data-v-325add7b]{margin-top:calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px}@media (min-width: 640px){.VPHero[data-v-325add7b]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px}}@media (min-width: 960px){.VPHero[data-v-325add7b]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px}}.container[data-v-325add7b]{display:flex;flex-direction:column;margin:0 auto;max-width:1152px}@media (min-width: 960px){.container[data-v-325add7b]{flex-direction:row}}.main[data-v-325add7b]{position:relative;z-index:10;order:2;flex-grow:1;flex-shrink:0}.VPHero.has-image .container[data-v-325add7b]{text-align:center}@media (min-width: 960px){.VPHero.has-image .container[data-v-325add7b]{text-align:left}}@media (min-width: 960px){.main[data-v-325add7b]{order:1;width:calc((100% / 3) * 2)}.VPHero.has-image .main[data-v-325add7b]{max-width:592px}}.name[data-v-325add7b],.text[data-v-325add7b]{max-width:392px;letter-spacing:-.4px;line-height:40px;font-size:32px;font-weight:700;white-space:pre-wrap}.VPHero.has-image .name[data-v-325add7b],.VPHero.has-image .text[data-v-325add7b]{margin:0 auto}.name[data-v-325add7b]{color:var(--vp-home-hero-name-color)}.clip[data-v-325add7b]{background:var(--vp-home-hero-name-background);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--vp-home-hero-name-color)}@media (min-width: 640px){.name[data-v-325add7b],.text[data-v-325add7b]{max-width:576px;line-height:56px;font-size:48px}}@media (min-width: 960px){.name[data-v-325add7b],.text[data-v-325add7b]{line-height:64px;font-size:56px}.VPHero.has-image .name[data-v-325add7b],.VPHero.has-image .text[data-v-325add7b]{margin:0}}.tagline[data-v-325add7b]{padding-top:8px;max-width:392px;line-height:28px;font-size:18px;font-weight:500;white-space:pre-wrap;color:var(--vp-c-text-2)}.VPHero.has-image .tagline[data-v-325add7b]{margin:0 auto}@media (min-width: 640px){.tagline[data-v-325add7b]{padding-top:12px;max-width:576px;line-height:32px;font-size:20px}}@media (min-width: 960px){.tagline[data-v-325add7b]{line-height:36px;font-size:24px}.VPHero.has-image .tagline[data-v-325add7b]{margin:0}}.actions[data-v-325add7b]{display:flex;flex-wrap:wrap;margin:-6px;padding-top:24px}.VPHero.has-image .actions[data-v-325add7b]{justify-content:center}@media (min-width: 640px){.actions[data-v-325add7b]{padding-top:32px}}@media (min-width: 960px){.VPHero.has-image .actions[data-v-325add7b]{justify-content:flex-start}}.action[data-v-325add7b]{flex-shrink:0;padding:6px}.image[data-v-325add7b]{order:1;margin:-76px -24px -48px}@media (min-width: 640px){.image[data-v-325add7b]{margin:-108px -24px -48px}}@media (min-width: 960px){.image[data-v-325add7b]{flex-grow:1;order:2;margin:0;min-height:100%}}.image-container[data-v-325add7b]{position:relative;margin:0 auto;width:320px;height:320px}@media (min-width: 640px){.image-container[data-v-325add7b]{width:392px;height:392px}}@media (min-width: 960px){.image-container[data-v-325add7b]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;transform:translate(-32px,-32px)}}.image-bg[data-v-325add7b]{position:absolute;top:50%;left:50%;border-radius:50%;width:192px;height:192px;background-image:var(--vp-home-hero-image-background-image);filter:var(--vp-home-hero-image-filter);transform:translate(-50%,-50%)}@media (min-width: 640px){.image-bg[data-v-325add7b]{width:256px;height:256px}}@media (min-width: 960px){.image-bg[data-v-325add7b]{width:320px;height:320px}}[data-v-325add7b] .image-src{position:absolute;top:50%;left:50%;max-width:192px;max-height:192px;transform:translate(-50%,-50%)}@media (min-width: 640px){[data-v-325add7b] .image-src{max-width:256px;max-height:256px}}@media (min-width: 960px){[data-v-325add7b] .image-src{max-width:320px;max-height:320px}}.VPFeature[data-v-248ed6b6]{display:block;border:1px solid var(--vp-c-bg-soft);border-radius:12px;height:100%;background-color:var(--vp-c-bg-soft);transition:border-color .25s,background-color .25s}.VPFeature.link[data-v-248ed6b6]:hover{border-color:var(--vp-c-brand-1)}.box[data-v-248ed6b6]{display:flex;flex-direction:column;padding:24px;height:100%}.box[data-v-248ed6b6]>.VPImage{margin-bottom:20px}.icon[data-v-248ed6b6]{display:flex;justify-content:center;align-items:center;margin-bottom:20px;border-radius:6px;background-color:var(--vp-c-default-soft);width:48px;height:48px;font-size:24px;transition:background-color .25s}.title[data-v-248ed6b6]{line-height:24px;font-size:16px;font-weight:600}.details[data-v-248ed6b6]{flex-grow:1;padding-top:8px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.link-text[data-v-248ed6b6]{padding-top:8px}.link-text-value[data-v-248ed6b6]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.link-text-icon[data-v-248ed6b6]{margin-left:6px}.VPFeatures[data-v-dbb08ed4]{position:relative;padding:0 24px}@media (min-width: 640px){.VPFeatures[data-v-dbb08ed4]{padding:0 48px}}@media (min-width: 960px){.VPFeatures[data-v-dbb08ed4]{padding:0 64px}}.container[data-v-dbb08ed4]{margin:0 auto;max-width:1152px}.items[data-v-dbb08ed4]{display:flex;flex-wrap:wrap;margin:-8px}.item[data-v-dbb08ed4]{padding:8px;width:100%}@media (min-width: 640px){.item.grid-2[data-v-dbb08ed4],.item.grid-4[data-v-dbb08ed4],.item.grid-6[data-v-dbb08ed4]{width:50%}}@media (min-width: 768px){.item.grid-2[data-v-dbb08ed4],.item.grid-4[data-v-dbb08ed4]{width:50%}.item.grid-3[data-v-dbb08ed4],.item.grid-6[data-v-dbb08ed4]{width:calc(100% / 3)}}@media (min-width: 960px){.item.grid-4[data-v-dbb08ed4]{width:25%}}.container[data-v-bb690f02]{margin:auto;width:100%;max-width:1280px;padding:0 24px}@media (min-width: 640px){.container[data-v-bb690f02]{padding:0 48px}}@media (min-width: 960px){.container[data-v-bb690f02]{width:100%;padding:0 64px}}.vp-doc[data-v-bb690f02] .VPHomeSponsors,.vp-doc[data-v-bb690f02] .VPTeamPage{margin-left:var(--vp-offset, calc(50% - 50vw) );margin-right:var(--vp-offset, calc(50% - 50vw) )}.vp-doc[data-v-bb690f02] .VPHomeSponsors h2{border-top:none;letter-spacing:normal}.vp-doc[data-v-bb690f02] .VPHomeSponsors a,.vp-doc[data-v-bb690f02] .VPTeamPage a{text-decoration:none}.VPHome[data-v-972a96f9]{margin-bottom:96px}@media (min-width: 768px){.VPHome[data-v-972a96f9]{margin-bottom:128px}}.VPContent[data-v-ec7dbf3e]{flex-grow:1;flex-shrink:0;margin:var(--vp-layout-top-height, 0px) auto 0;width:100%}.VPContent.is-home[data-v-ec7dbf3e]{width:100%;max-width:100%}.VPContent.has-sidebar[data-v-ec7dbf3e]{margin:0}@media (min-width: 960px){.VPContent[data-v-ec7dbf3e]{padding-top:var(--vp-nav-height)}.VPContent.has-sidebar[data-v-ec7dbf3e]{margin:var(--vp-layout-top-height, 0px) 0 0;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPContent.has-sidebar[data-v-ec7dbf3e]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.VPFooter[data-v-e3ca6860]{position:relative;z-index:var(--vp-z-index-footer);border-top:1px solid var(--vp-c-gutter);padding:32px 24px;background-color:var(--vp-c-bg)}.VPFooter.has-sidebar[data-v-e3ca6860]{display:none}.VPFooter[data-v-e3ca6860] a{text-decoration-line:underline;text-underline-offset:2px;transition:color .25s}.VPFooter[data-v-e3ca6860] a:hover{color:var(--vp-c-text-1)}@media (min-width: 768px){.VPFooter[data-v-e3ca6860]{padding:32px}}.container[data-v-e3ca6860]{margin:0 auto;max-width:var(--vp-layout-max-width);text-align:center}.message[data-v-e3ca6860],.copyright[data-v-e3ca6860]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.VPLocalNavOutlineDropdown[data-v-b418bf42]{padding:12px 20px 11px}@media (min-width: 960px){.VPLocalNavOutlineDropdown[data-v-b418bf42]{padding:12px 36px 11px}}.VPLocalNavOutlineDropdown button[data-v-b418bf42]{display:block;font-size:12px;font-weight:500;line-height:24px;color:var(--vp-c-text-2);transition:color .5s;position:relative}.VPLocalNavOutlineDropdown button[data-v-b418bf42]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPLocalNavOutlineDropdown button.open[data-v-b418bf42]{color:var(--vp-c-text-1)}.icon[data-v-b418bf42]{display:inline-block;vertical-align:middle;margin-left:2px;font-size:14px;transform:rotate(0);transition:transform .25s}@media (min-width: 960px){.VPLocalNavOutlineDropdown button[data-v-b418bf42]{font-size:14px}.icon[data-v-b418bf42]{font-size:16px}}.open>.icon[data-v-b418bf42]{transform:rotate(90deg)}.items[data-v-b418bf42]{position:absolute;top:40px;right:16px;left:16px;display:grid;gap:1px;border:1px solid var(--vp-c-border);border-radius:8px;background-color:var(--vp-c-gutter);max-height:calc(var(--vp-vh, 100vh) - 86px);overflow:hidden auto;box-shadow:var(--vp-shadow-3)}@media (min-width: 960px){.items[data-v-b418bf42]{right:auto;left:calc(var(--vp-sidebar-width) + 32px);width:320px}}.header[data-v-b418bf42]{background-color:var(--vp-c-bg-soft)}.top-link[data-v-b418bf42]{display:block;padding:0 16px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.outline[data-v-b418bf42]{padding:8px 0;background-color:var(--vp-c-bg-soft)}.flyout-enter-active[data-v-b418bf42]{transition:all .2s ease-out}.flyout-leave-active[data-v-b418bf42]{transition:all .15s ease-in}.flyout-enter-from[data-v-b418bf42],.flyout-leave-to[data-v-b418bf42]{opacity:0;transform:translateY(-16px)}.VPLocalNav[data-v-8af612ea]{position:sticky;top:0;left:0;z-index:var(--vp-z-index-local-nav);border-bottom:1px solid var(--vp-c-gutter);padding-top:var(--vp-layout-top-height, 0px);width:100%;background-color:var(--vp-local-nav-bg-color)}.VPLocalNav.fixed[data-v-8af612ea]{position:fixed}@media (min-width: 960px){.VPLocalNav[data-v-8af612ea]{top:var(--vp-nav-height)}.VPLocalNav.has-sidebar[data-v-8af612ea]{padding-left:var(--vp-sidebar-width)}.VPLocalNav.empty[data-v-8af612ea]{display:none}}@media (min-width: 1280px){.VPLocalNav[data-v-8af612ea]{display:none}}@media (min-width: 1440px){.VPLocalNav.has-sidebar[data-v-8af612ea]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.container[data-v-8af612ea]{display:flex;justify-content:space-between;align-items:center}.menu[data-v-8af612ea]{display:flex;align-items:center;padding:12px 24px 11px;line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.menu[data-v-8af612ea]:hover{color:var(--vp-c-text-1);transition:color .25s}@media (min-width: 768px){.menu[data-v-8af612ea]{padding:0 32px}}@media (min-width: 960px){.menu[data-v-8af612ea]{display:none}}.menu-icon[data-v-8af612ea]{margin-right:8px;font-size:14px}.VPOutlineDropdown[data-v-8af612ea]{padding:12px 24px 11px}@media (min-width: 768px){.VPOutlineDropdown[data-v-8af612ea]{padding:12px 32px 11px}}.VPSwitch[data-v-d82e607b]{position:relative;border-radius:11px;display:block;width:40px;height:22px;flex-shrink:0;border:1px solid var(--vp-input-border-color);background-color:var(--vp-input-switch-bg-color);transition:border-color .25s!important}.VPSwitch[data-v-d82e607b]:hover{border-color:var(--vp-c-brand-1)}.check[data-v-d82e607b]{position:absolute;top:1px;left:1px;width:18px;height:18px;border-radius:50%;background-color:var(--vp-c-neutral-inverse);box-shadow:var(--vp-shadow-1);transition:transform .25s!important}.icon[data-v-d82e607b]{position:relative;display:block;width:18px;height:18px;border-radius:50%;overflow:hidden}.icon[data-v-d82e607b] [class^=vpi-]{position:absolute;top:3px;left:3px;width:12px;height:12px;color:var(--vp-c-text-2)}.dark .icon[data-v-d82e607b] [class^=vpi-]{color:var(--vp-c-text-1);transition:opacity .25s!important}.sun[data-v-3a50aa5c]{opacity:1}.moon[data-v-3a50aa5c],.dark .sun[data-v-3a50aa5c]{opacity:0}.dark .moon[data-v-3a50aa5c]{opacity:1}.dark .VPSwitchAppearance[data-v-3a50aa5c] .check{transform:translate(18px)}.VPNavBarAppearance[data-v-2a6692f8]{display:none}@media (min-width: 1280px){.VPNavBarAppearance[data-v-2a6692f8]{display:flex;align-items:center}}.VPMenuGroup+.VPMenuLink[data-v-79776a7a]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.link[data-v-79776a7a]{display:block;border-radius:6px;padding:0 12px;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);white-space:nowrap;transition:background-color .25s,color .25s}.link[data-v-79776a7a]:hover{color:var(--vp-c-brand-1);background-color:var(--vp-c-default-soft)}.link.active[data-v-79776a7a]{color:var(--vp-c-brand-1)}.VPMenuGroup[data-v-fbf15ead]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.VPMenuGroup[data-v-fbf15ead]:first-child{margin-top:0;border-top:0;padding-top:0}.VPMenuGroup+.VPMenuGroup[data-v-fbf15ead]{margin-top:12px;border-top:1px solid var(--vp-c-divider)}.title[data-v-fbf15ead]{padding:0 12px;line-height:32px;font-size:14px;font-weight:600;color:var(--vp-c-text-2);white-space:nowrap;transition:color .25s}.VPMenu[data-v-9990563e]{border-radius:12px;padding:12px;min-width:128px;border:1px solid var(--vp-c-divider);background-color:var(--vp-c-bg-elv);box-shadow:var(--vp-shadow-3);transition:background-color .5s;max-height:calc(100vh - var(--vp-nav-height));overflow-y:auto}.VPMenu[data-v-9990563e] .group{margin:0 -12px;padding:0 12px 12px}.VPMenu[data-v-9990563e] .group+.group{border-top:1px solid var(--vp-c-divider);padding:11px 12px 12px}.VPMenu[data-v-9990563e] .group:last-child{padding-bottom:0}.VPMenu[data-v-9990563e] .group+.item{border-top:1px solid var(--vp-c-divider);padding:11px 16px 0}.VPMenu[data-v-9990563e] .item{padding:0 16px;white-space:nowrap}.VPMenu[data-v-9990563e] .label{flex-grow:1;line-height:28px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.VPMenu[data-v-9990563e] .action{padding-left:24px}.VPFlyout[data-v-ec8c49bc]{position:relative}.VPFlyout[data-v-ec8c49bc]:hover{color:var(--vp-c-brand-1);transition:color .25s}.VPFlyout:hover .text[data-v-ec8c49bc]{color:var(--vp-c-text-2)}.VPFlyout:hover .icon[data-v-ec8c49bc]{fill:var(--vp-c-text-2)}.VPFlyout.active .text[data-v-ec8c49bc]{color:var(--vp-c-brand-1)}.VPFlyout.active:hover .text[data-v-ec8c49bc]{color:var(--vp-c-brand-2)}.VPFlyout:hover .menu[data-v-ec8c49bc],.button[aria-expanded=true]+.menu[data-v-ec8c49bc]{opacity:1;visibility:visible;transform:translateY(0)}.button[aria-expanded=false]+.menu[data-v-ec8c49bc]{opacity:0;visibility:hidden;transform:translateY(0)}.button[data-v-ec8c49bc]{display:flex;align-items:center;padding:0 12px;height:var(--vp-nav-height);color:var(--vp-c-text-1);transition:color .5s}.text[data-v-ec8c49bc]{display:flex;align-items:center;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.option-icon[data-v-ec8c49bc]{margin-right:0;font-size:16px}.text-icon[data-v-ec8c49bc]{margin-left:4px;font-size:14px}.icon[data-v-ec8c49bc]{font-size:20px;transition:fill .25s}.menu[data-v-ec8c49bc]{position:absolute;top:calc(var(--vp-nav-height) / 2 + 20px);right:0;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s,transform .25s}.VPSocialLink[data-v-b0526bd7]{display:flex;justify-content:center;align-items:center;width:36px;height:36px;color:var(--vp-c-text-2);transition:color .5s}.VPSocialLink[data-v-b0526bd7]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPSocialLink[data-v-b0526bd7]>svg,.VPSocialLink[data-v-b0526bd7]>[class^=vpi-social-]{width:20px;height:20px;fill:currentColor}.VPSocialLinks[data-v-fa18fe49]{display:flex;justify-content:center}.VPNavBarExtra[data-v-2fc967b6]{display:none;margin-right:-12px}@media (min-width: 768px){.VPNavBarExtra[data-v-2fc967b6]{display:block}}@media (min-width: 1280px){.VPNavBarExtra[data-v-2fc967b6]{display:none}}.trans-title[data-v-2fc967b6]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.item.appearance[data-v-2fc967b6],.item.social-links[data-v-2fc967b6]{display:flex;align-items:center;padding:0 12px}.item.appearance[data-v-2fc967b6]{min-width:176px}.appearance-action[data-v-2fc967b6]{margin-right:-2px}.social-links-list[data-v-2fc967b6]{margin:-4px -8px}.VPNavBarHamburger[data-v-be64de2d]{display:flex;justify-content:center;align-items:center;width:48px;height:var(--vp-nav-height)}@media (min-width: 768px){.VPNavBarHamburger[data-v-be64de2d]{display:none}}.container[data-v-be64de2d]{position:relative;width:16px;height:14px;overflow:hidden}.VPNavBarHamburger:hover .top[data-v-be64de2d]{top:0;left:0;transform:translate(4px)}.VPNavBarHamburger:hover .middle[data-v-be64de2d]{top:6px;left:0;transform:translate(0)}.VPNavBarHamburger:hover .bottom[data-v-be64de2d]{top:12px;left:0;transform:translate(8px)}.VPNavBarHamburger.active .top[data-v-be64de2d]{top:6px;transform:translate(0) rotate(225deg)}.VPNavBarHamburger.active .middle[data-v-be64de2d]{top:6px;transform:translate(16px)}.VPNavBarHamburger.active .bottom[data-v-be64de2d]{top:6px;transform:translate(0) rotate(135deg)}.VPNavBarHamburger.active:hover .top[data-v-be64de2d],.VPNavBarHamburger.active:hover .middle[data-v-be64de2d],.VPNavBarHamburger.active:hover .bottom[data-v-be64de2d]{background-color:var(--vp-c-text-2);transition:top .25s,background-color .25s,transform .25s}.top[data-v-be64de2d],.middle[data-v-be64de2d],.bottom[data-v-be64de2d]{position:absolute;width:16px;height:2px;background-color:var(--vp-c-text-1);transition:top .25s,background-color .5s,transform .25s}.top[data-v-be64de2d]{top:0;left:0;transform:translate(0)}.middle[data-v-be64de2d]{top:6px;left:0;transform:translate(8px)}.bottom[data-v-be64de2d]{top:12px;left:0;transform:translate(4px)}.VPNavBarMenuLink[data-v-ad4a8b64]{display:flex;align-items:center;padding:0 12px;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.VPNavBarMenuLink.active[data-v-ad4a8b64],.VPNavBarMenuLink[data-v-ad4a8b64]:hover{color:var(--vp-c-brand-1)}.VPNavBarMenu[data-v-0fb289c1]{display:none}@media (min-width: 768px){.VPNavBarMenu[data-v-0fb289c1]{display:flex}}/*! @docsearch/css 3.6.1 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 rgba(3,4,9,.30196078431372547);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;position:relative;padding:0 0 2px;border:0;top:-1px;width:20px}.DocSearch-Button-Key--pressed{transform:translate3d(0,1px,0);box-shadow:var(--docsearch-key-pressed-shadow)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;color:var(--docsearch-muted-color);border:0;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[class*=DocSearch]{--docsearch-primary-color: var(--vp-c-brand-1);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-text-color: var(--vp-c-text-1);--docsearch-muted-color: var(--vp-c-text-2);--docsearch-searchbox-shadow: none;--docsearch-searchbox-background: transparent;--docsearch-searchbox-focus-background: transparent;--docsearch-key-gradient: transparent;--docsearch-key-shadow: none;--docsearch-modal-background: var(--vp-c-bg-soft);--docsearch-footer-background: var(--vp-c-bg)}.dark [class*=DocSearch]{--docsearch-modal-shadow: none;--docsearch-footer-shadow: none;--docsearch-logo-color: var(--vp-c-text-2);--docsearch-hit-background: var(--vp-c-default-soft);--docsearch-hit-color: var(--vp-c-text-2);--docsearch-hit-shadow: none}.DocSearch-Button{display:flex;justify-content:center;align-items:center;margin:0;padding:0;width:48px;height:55px;background:transparent;transition:border-color .25s}.DocSearch-Button:hover{background:transparent}.DocSearch-Button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.DocSearch-Button-Key--pressed{transform:none;box-shadow:none}.DocSearch-Button:focus:not(:focus-visible){outline:none!important}@media (min-width: 768px){.DocSearch-Button{justify-content:flex-start;border:1px solid transparent;border-radius:8px;padding:0 10px 0 12px;width:100%;height:40px;background-color:var(--vp-c-bg-alt)}.DocSearch-Button:hover{border-color:var(--vp-c-brand-1);background:var(--vp-c-bg-alt)}}.DocSearch-Button .DocSearch-Button-Container{display:flex;align-items:center}.DocSearch-Button .DocSearch-Search-Icon{position:relative;width:16px;height:16px;color:var(--vp-c-text-1);fill:currentColor;transition:color .5s}.DocSearch-Button:hover .DocSearch-Search-Icon{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Search-Icon{top:1px;margin-right:8px;width:14px;height:14px;color:var(--vp-c-text-2)}}.DocSearch-Button .DocSearch-Button-Placeholder{display:none;margin-top:2px;padding:0 16px 0 0;font-size:13px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.DocSearch-Button:hover .DocSearch-Button-Placeholder{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Placeholder{display:inline-block}}.DocSearch-Button .DocSearch-Button-Keys{direction:ltr;display:none;min-width:auto}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Keys{display:flex;align-items:center}}.DocSearch-Button .DocSearch-Button-Key{display:block;margin:2px 0 0;border:1px solid var(--vp-c-divider);border-right:none;border-radius:4px 0 0 4px;padding-left:6px;min-width:0;width:auto;height:22px;line-height:22px;font-family:var(--vp-font-family-base);font-size:12px;font-weight:500;transition:color .5s,border-color .5s}.DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key{border-right:1px solid var(--vp-c-divider);border-left:none;border-radius:0 4px 4px 0;padding-left:2px;padding-right:6px}.DocSearch-Button .DocSearch-Button-Key:first-child{font-size:0!important}.DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"Ctrl";font-size:12px;letter-spacing:normal;color:var(--docsearch-muted-color)}.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"⌘"}.DocSearch-Button .DocSearch-Button-Key:first-child>*{display:none}.DocSearch-Search-Icon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E")}.VPNavBarSearch{display:flex;align-items:center}@media (min-width: 768px){.VPNavBarSearch{flex-grow:1;padding-left:24px}}@media (min-width: 960px){.VPNavBarSearch{padding-left:32px}}.dark .DocSearch-Footer{border-top:1px solid var(--vp-c-divider)}.DocSearch-Form{border:1px solid var(--vp-c-brand-1);background-color:var(--vp-c-white)}.dark .DocSearch-Form{background-color:var(--vp-c-default-soft)}.DocSearch-Screen-Icon>svg{margin:auto}.VPNavBarSocialLinks[data-v-f3b91b3a]{display:none}@media (min-width: 1280px){.VPNavBarSocialLinks[data-v-f3b91b3a]{display:flex;align-items:center}}.title[data-v-10b95b50]{display:flex;align-items:center;border-bottom:1px solid transparent;width:100%;height:var(--vp-nav-height);font-size:16px;font-weight:600;color:var(--vp-c-text-1);transition:opacity .25s}@media (min-width: 960px){.title[data-v-10b95b50]{flex-shrink:0}.VPNavBarTitle.has-sidebar .title[data-v-10b95b50]{border-bottom-color:var(--vp-c-divider)}}[data-v-10b95b50] .logo{margin-right:8px;height:var(--vp-nav-logo-height)}.VPNavBarTranslations[data-v-cd7b67e8]{display:none}@media (min-width: 1280px){.VPNavBarTranslations[data-v-cd7b67e8]{display:flex;align-items:center}}.title[data-v-cd7b67e8]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.VPNavBar[data-v-1303e283]{position:relative;height:var(--vp-nav-height);pointer-events:none;white-space:nowrap;transition:background-color .25s}.VPNavBar.screen-open[data-v-1303e283]{transition:none;background-color:var(--vp-nav-bg-color);border-bottom:1px solid var(--vp-c-divider)}.VPNavBar[data-v-1303e283]:not(.home){background-color:var(--vp-nav-bg-color)}@media (min-width: 960px){.VPNavBar[data-v-1303e283]:not(.home){background-color:transparent}.VPNavBar[data-v-1303e283]:not(.has-sidebar):not(.home.top){background-color:var(--vp-nav-bg-color)}}.wrapper[data-v-1303e283]{padding:0 8px 0 24px}@media (min-width: 768px){.wrapper[data-v-1303e283]{padding:0 32px}}@media (min-width: 960px){.VPNavBar.has-sidebar .wrapper[data-v-1303e283]{padding:0}}.container[data-v-1303e283]{display:flex;justify-content:space-between;margin:0 auto;max-width:calc(var(--vp-layout-max-width) - 64px);height:var(--vp-nav-height);pointer-events:none}.container>.title[data-v-1303e283],.container>.content[data-v-1303e283]{pointer-events:none}.container[data-v-1303e283] *{pointer-events:auto}@media (min-width: 960px){.VPNavBar.has-sidebar .container[data-v-1303e283]{max-width:100%}}.title[data-v-1303e283]{flex-shrink:0;height:calc(var(--vp-nav-height) - 1px);transition:background-color .5s}@media (min-width: 960px){.VPNavBar.has-sidebar .title[data-v-1303e283]{position:absolute;top:0;left:0;z-index:2;padding:0 32px;width:var(--vp-sidebar-width);height:var(--vp-nav-height);background-color:transparent}}@media (min-width: 1440px){.VPNavBar.has-sidebar .title[data-v-1303e283]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}.content[data-v-1303e283]{flex-grow:1}@media (min-width: 960px){.VPNavBar.has-sidebar .content[data-v-1303e283]{position:relative;z-index:1;padding-right:32px;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .content[data-v-1303e283]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2 + 32px);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.content-body[data-v-1303e283]{display:flex;justify-content:flex-end;align-items:center;height:var(--vp-nav-height);transition:background-color .5s}@media (min-width: 960px){.VPNavBar:not(.home.top) .content-body[data-v-1303e283]{position:relative;background-color:var(--vp-nav-bg-color)}.VPNavBar:not(.has-sidebar):not(.home.top) .content-body[data-v-1303e283]{background-color:transparent}}@media (max-width: 767px){.content-body[data-v-1303e283]{column-gap:.5rem}}.menu+.translations[data-v-1303e283]:before,.menu+.appearance[data-v-1303e283]:before,.menu+.social-links[data-v-1303e283]:before,.translations+.appearance[data-v-1303e283]:before,.appearance+.social-links[data-v-1303e283]:before{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--vp-c-divider);content:""}.menu+.appearance[data-v-1303e283]:before,.translations+.appearance[data-v-1303e283]:before{margin-right:16px}.appearance+.social-links[data-v-1303e283]:before{margin-left:16px}.social-links[data-v-1303e283]{margin-right:-8px}.divider[data-v-1303e283]{width:100%;height:1px}@media (min-width: 960px){.VPNavBar.has-sidebar .divider[data-v-1303e283]{padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .divider[data-v-1303e283]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.divider-line[data-v-1303e283]{width:100%;height:1px;transition:background-color .5s}.VPNavBar:not(.home) .divider-line[data-v-1303e283]{background-color:var(--vp-c-gutter)}@media (min-width: 960px){.VPNavBar:not(.home.top) .divider-line[data-v-1303e283]{background-color:var(--vp-c-gutter)}.VPNavBar:not(.has-sidebar):not(.home.top) .divider[data-v-1303e283]{background-color:var(--vp-c-gutter)}}.VPNavScreenAppearance[data-v-79da70de]{display:flex;justify-content:space-between;align-items:center;border-radius:8px;padding:12px 14px 12px 16px;background-color:var(--vp-c-bg-soft)}.text[data-v-79da70de]{line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.VPNavScreenMenuLink[data-v-9a3ef902]{display:block;border-bottom:1px solid var(--vp-c-divider);padding:12px 0 11px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:border-color .25s,color .25s}.VPNavScreenMenuLink[data-v-9a3ef902]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupLink[data-v-03f7344f]{display:block;margin-left:12px;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-1);transition:color .25s}.VPNavScreenMenuGroupLink[data-v-03f7344f]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupSection[data-v-3b79ab2a]{display:block}.title[data-v-3b79ab2a]{line-height:32px;font-size:13px;font-weight:700;color:var(--vp-c-text-2);transition:color .25s}.VPNavScreenMenuGroup[data-v-496537ac]{border-bottom:1px solid var(--vp-c-divider);height:48px;overflow:hidden;transition:border-color .5s}.VPNavScreenMenuGroup .items[data-v-496537ac]{visibility:hidden}.VPNavScreenMenuGroup.open .items[data-v-496537ac]{visibility:visible}.VPNavScreenMenuGroup.open[data-v-496537ac]{padding-bottom:10px;height:auto}.VPNavScreenMenuGroup.open .button[data-v-496537ac]{padding-bottom:6px;color:var(--vp-c-brand-1)}.VPNavScreenMenuGroup.open .button-icon[data-v-496537ac]{transform:rotate(45deg)}.button[data-v-496537ac]{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 11px 0;width:100%;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.button[data-v-496537ac]:hover{color:var(--vp-c-brand-1)}.button-icon[data-v-496537ac]{transition:transform .25s}.group[data-v-496537ac]:first-child{padding-top:0}.group+.group[data-v-496537ac],.group+.item[data-v-496537ac]{padding-top:4px}.VPNavScreenTranslations[data-v-c618ff37]{height:24px;overflow:hidden}.VPNavScreenTranslations.open[data-v-c618ff37]{height:auto}.title[data-v-c618ff37]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-text-1)}.icon[data-v-c618ff37]{font-size:16px}.icon.lang[data-v-c618ff37]{margin-right:8px}.icon.chevron[data-v-c618ff37]{margin-left:4px}.list[data-v-c618ff37]{padding:4px 0 0 24px}.link[data-v-c618ff37]{line-height:32px;font-size:13px;color:var(--vp-c-text-1)}.VPNavScreen[data-v-c3a48aed]{position:fixed;top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px));right:0;bottom:0;left:0;padding:0 32px;width:100%;background-color:var(--vp-nav-screen-bg-color);overflow-y:auto;transition:background-color .25s;pointer-events:auto}.VPNavScreen.fade-enter-active[data-v-c3a48aed],.VPNavScreen.fade-leave-active[data-v-c3a48aed]{transition:opacity .25s}.VPNavScreen.fade-enter-active .container[data-v-c3a48aed],.VPNavScreen.fade-leave-active .container[data-v-c3a48aed]{transition:transform .25s ease}.VPNavScreen.fade-enter-from[data-v-c3a48aed],.VPNavScreen.fade-leave-to[data-v-c3a48aed]{opacity:0}.VPNavScreen.fade-enter-from .container[data-v-c3a48aed],.VPNavScreen.fade-leave-to .container[data-v-c3a48aed]{transform:translateY(-8px)}@media (min-width: 768px){.VPNavScreen[data-v-c3a48aed]{display:none}}.container[data-v-c3a48aed]{margin:0 auto;padding:24px 0 96px;max-width:288px}.menu+.translations[data-v-c3a48aed],.menu+.appearance[data-v-c3a48aed],.translations+.appearance[data-v-c3a48aed]{margin-top:24px}.menu+.social-links[data-v-c3a48aed]{margin-top:16px}.appearance+.social-links[data-v-c3a48aed]{margin-top:16px}.VPNav[data-v-2a4e514e]{position:relative;top:var(--vp-layout-top-height, 0px);left:0;z-index:var(--vp-z-index-nav);width:100%;pointer-events:none;transition:background-color .5s}@media (min-width: 960px){.VPNav[data-v-2a4e514e]{position:fixed}}.VPSidebarItem.level-0[data-v-9035698b]{padding-bottom:24px}.VPSidebarItem.collapsed.level-0[data-v-9035698b]{padding-bottom:10px}.item[data-v-9035698b]{position:relative;display:flex;width:100%}.VPSidebarItem.collapsible>.item[data-v-9035698b]{cursor:pointer}.indicator[data-v-9035698b]{position:absolute;top:6px;bottom:6px;left:-17px;width:2px;border-radius:2px;transition:background-color .25s}.VPSidebarItem.level-2.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-3.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-4.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-5.is-active>.item>.indicator[data-v-9035698b]{background-color:var(--vp-c-brand-1)}.link[data-v-9035698b]{display:flex;align-items:center;flex-grow:1}.text[data-v-9035698b]{flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;transition:color .25s}.VPSidebarItem.level-0 .text[data-v-9035698b]{font-weight:700;color:var(--vp-c-text-1)}.VPSidebarItem.level-1 .text[data-v-9035698b],.VPSidebarItem.level-2 .text[data-v-9035698b],.VPSidebarItem.level-3 .text[data-v-9035698b],.VPSidebarItem.level-4 .text[data-v-9035698b],.VPSidebarItem.level-5 .text[data-v-9035698b]{font-weight:500;color:var(--vp-c-text-2)}.VPSidebarItem.level-0.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-1.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-2.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-3.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-4.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-5.is-link>.item>.link:hover .text[data-v-9035698b]{color:var(--vp-c-brand-1)}.VPSidebarItem.level-0.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-1.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-2.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-3.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-4.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-5.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-0.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-1.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-2.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-3.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-4.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-5.has-active>.item>.link>.text[data-v-9035698b]{color:var(--vp-c-text-1)}.VPSidebarItem.level-0.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-1.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-2.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-3.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-4.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-5.is-active>.item .link>.text[data-v-9035698b]{color:var(--vp-c-brand-1)}.caret[data-v-9035698b]{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--vp-c-text-3);cursor:pointer;transition:color .25s;flex-shrink:0}.item:hover .caret[data-v-9035698b]{color:var(--vp-c-text-2)}.item:hover .caret[data-v-9035698b]:hover{color:var(--vp-c-text-1)}.caret-icon[data-v-9035698b]{font-size:18px;transform:rotate(90deg);transition:transform .25s}.VPSidebarItem.collapsed .caret-icon[data-v-9035698b]{transform:rotate(0)}.VPSidebarItem.level-1 .items[data-v-9035698b],.VPSidebarItem.level-2 .items[data-v-9035698b],.VPSidebarItem.level-3 .items[data-v-9035698b],.VPSidebarItem.level-4 .items[data-v-9035698b],.VPSidebarItem.level-5 .items[data-v-9035698b]{border-left:1px solid var(--vp-c-divider);padding-left:16px}.VPSidebarItem.collapsed .items[data-v-9035698b]{display:none}.no-transition[data-v-c3eaeb1a] .caret-icon{transition:none}.group+.group[data-v-c3eaeb1a]{border-top:1px solid var(--vp-c-divider);padding-top:10px}@media (min-width: 960px){.group[data-v-c3eaeb1a]{padding-top:10px;width:calc(var(--vp-sidebar-width) - 64px)}}.VPSidebar[data-v-edd7de80]{position:fixed;top:var(--vp-layout-top-height, 0px);bottom:0;left:0;z-index:var(--vp-z-index-sidebar);padding:32px 32px 96px;width:calc(100vw - 64px);max-width:320px;background-color:var(--vp-sidebar-bg-color);opacity:0;box-shadow:var(--vp-c-shadow-3);overflow-x:hidden;overflow-y:auto;transform:translate(-100%);transition:opacity .5s,transform .25s ease;overscroll-behavior:contain}.VPSidebar.open[data-v-edd7de80]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .25s,transform .5s cubic-bezier(.19,1,.22,1)}.dark .VPSidebar[data-v-edd7de80]{box-shadow:var(--vp-shadow-1)}@media (min-width: 960px){.VPSidebar[data-v-edd7de80]{padding-top:var(--vp-nav-height);width:var(--vp-sidebar-width);max-width:100%;background-color:var(--vp-sidebar-bg-color);opacity:1;visibility:visible;box-shadow:none;transform:translate(0)}}@media (min-width: 1440px){.VPSidebar[data-v-edd7de80]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}@media (min-width: 960px){.curtain[data-v-edd7de80]{position:sticky;top:-64px;left:0;z-index:1;margin-top:calc(var(--vp-nav-height) * -1);margin-right:-32px;margin-left:-32px;height:var(--vp-nav-height);background-color:var(--vp-sidebar-bg-color)}}.nav[data-v-edd7de80]{outline:0}.VPSkipLink[data-v-3e86afbf]{top:8px;left:8px;padding:8px 16px;z-index:999;border-radius:8px;font-size:12px;font-weight:700;text-decoration:none;color:var(--vp-c-brand-1);box-shadow:var(--vp-shadow-3);background-color:var(--vp-c-bg)}.VPSkipLink[data-v-3e86afbf]:focus{height:auto;width:auto;clip:auto;clip-path:none}@media (min-width: 1280px){.VPSkipLink[data-v-3e86afbf]{top:14px;left:16px}}.Layout[data-v-22f859ac]{display:flex;flex-direction:column;min-height:100vh}.VPHomeSponsors[data-v-65f3b3fb]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPHomeSponsors[data-v-65f3b3fb]{margin:96px 0}@media (min-width: 768px){.VPHomeSponsors[data-v-65f3b3fb]{margin:128px 0}}.VPHomeSponsors[data-v-65f3b3fb]{padding:0 24px}@media (min-width: 768px){.VPHomeSponsors[data-v-65f3b3fb]{padding:0 48px}}@media (min-width: 960px){.VPHomeSponsors[data-v-65f3b3fb]{padding:0 64px}}.container[data-v-65f3b3fb]{margin:0 auto;max-width:1152px}.love[data-v-65f3b3fb]{margin:0 auto;width:fit-content;font-size:28px;color:var(--vp-c-text-3)}.icon[data-v-65f3b3fb]{display:inline-block}.message[data-v-65f3b3fb]{margin:0 auto;padding-top:10px;max-width:320px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.sponsors[data-v-65f3b3fb]{padding-top:32px}.action[data-v-65f3b3fb]{padding-top:40px;text-align:center}.VPTeamPage[data-v-7ee49781]{margin:96px 0}@media (min-width: 768px){.VPTeamPage[data-v-7ee49781]{margin:128px 0}}.VPHome .VPTeamPageTitle[data-v-7ee49781-s]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPTeamPageSection+.VPTeamPageSection[data-v-7ee49781-s],.VPTeamMembers+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:64px}.VPTeamMembers+.VPTeamMembers[data-v-7ee49781-s]{margin-top:24px}@media (min-width: 768px){.VPTeamPageTitle+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:16px}.VPTeamPageSection+.VPTeamPageSection[data-v-7ee49781-s],.VPTeamMembers+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:96px}}.VPTeamMembers[data-v-7ee49781-s]{padding:0 24px}@media (min-width: 768px){.VPTeamMembers[data-v-7ee49781-s]{padding:0 48px}}@media (min-width: 960px){.VPTeamMembers[data-v-7ee49781-s]{padding:0 64px}}.VPTeamPageTitle[data-v-7199c4a1]{padding:48px 32px;text-align:center}@media (min-width: 768px){.VPTeamPageTitle[data-v-7199c4a1]{padding:64px 48px 48px}}@media (min-width: 960px){.VPTeamPageTitle[data-v-7199c4a1]{padding:80px 64px 48px}}.title[data-v-7199c4a1]{letter-spacing:0;line-height:44px;font-size:36px;font-weight:500}@media (min-width: 768px){.title[data-v-7199c4a1]{letter-spacing:-.5px;line-height:56px;font-size:48px}}.lead[data-v-7199c4a1]{margin:0 auto;max-width:512px;padding-top:12px;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 768px){.lead[data-v-7199c4a1]{max-width:592px;letter-spacing:.15px;line-height:28px;font-size:20px}}.VPTeamPageSection[data-v-e7d273f9]{padding:0 32px}@media (min-width: 768px){.VPTeamPageSection[data-v-e7d273f9]{padding:0 48px}}@media (min-width: 960px){.VPTeamPageSection[data-v-e7d273f9]{padding:0 64px}}.title[data-v-e7d273f9]{position:relative;margin:0 auto;max-width:1152px;text-align:center;color:var(--vp-c-text-2)}.title-line[data-v-e7d273f9]{position:absolute;top:16px;left:0;width:100%;height:1px;background-color:var(--vp-c-divider)}.title-text[data-v-e7d273f9]{position:relative;display:inline-block;padding:0 24px;letter-spacing:0;line-height:32px;font-size:20px;font-weight:500;background-color:var(--vp-c-bg)}.lead[data-v-e7d273f9]{margin:0 auto;max-width:480px;padding-top:12px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.members[data-v-e7d273f9]{padding-top:40px}.VPTeamMembersItem[data-v-37dee882]{display:flex;flex-direction:column;gap:2px;border-radius:12px;width:100%;height:100%;overflow:hidden}.VPTeamMembersItem.small .profile[data-v-37dee882]{padding:32px}.VPTeamMembersItem.small .data[data-v-37dee882]{padding-top:20px}.VPTeamMembersItem.small .avatar[data-v-37dee882]{width:64px;height:64px}.VPTeamMembersItem.small .name[data-v-37dee882]{line-height:24px;font-size:16px}.VPTeamMembersItem.small .affiliation[data-v-37dee882]{padding-top:4px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .desc[data-v-37dee882]{padding-top:12px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .links[data-v-37dee882]{margin:0 -16px -20px;padding:10px 0 0}.VPTeamMembersItem.medium .profile[data-v-37dee882]{padding:48px 32px}.VPTeamMembersItem.medium .data[data-v-37dee882]{padding-top:24px;text-align:center}.VPTeamMembersItem.medium .avatar[data-v-37dee882]{width:96px;height:96px}.VPTeamMembersItem.medium .name[data-v-37dee882]{letter-spacing:.15px;line-height:28px;font-size:20px}.VPTeamMembersItem.medium .affiliation[data-v-37dee882]{padding-top:4px;font-size:16px}.VPTeamMembersItem.medium .desc[data-v-37dee882]{padding-top:16px;max-width:288px;font-size:16px}.VPTeamMembersItem.medium .links[data-v-37dee882]{margin:0 -16px -12px;padding:16px 12px 0}.profile[data-v-37dee882]{flex-grow:1;background-color:var(--vp-c-bg-soft)}.data[data-v-37dee882]{text-align:center}.avatar[data-v-37dee882]{position:relative;flex-shrink:0;margin:0 auto;border-radius:50%;box-shadow:var(--vp-shadow-3)}.avatar-img[data-v-37dee882]{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;object-fit:cover}.name[data-v-37dee882]{margin:0;font-weight:600}.affiliation[data-v-37dee882]{margin:0;font-weight:500;color:var(--vp-c-text-2)}.org.link[data-v-37dee882]{color:var(--vp-c-text-2);transition:color .25s}.org.link[data-v-37dee882]:hover{color:var(--vp-c-brand-1)}.desc[data-v-37dee882]{margin:0 auto}.desc[data-v-37dee882] a{font-weight:500;color:var(--vp-c-brand-1);text-decoration-style:dotted;transition:color .25s}.links[data-v-37dee882]{display:flex;justify-content:center;height:56px}.sp-link[data-v-37dee882]{display:flex;justify-content:center;align-items:center;text-align:center;padding:16px;font-size:14px;font-weight:500;color:var(--vp-c-sponsor);background-color:var(--vp-c-bg-soft);transition:color .25s,background-color .25s}.sp .sp-link.link[data-v-37dee882]:hover,.sp .sp-link.link[data-v-37dee882]:focus{outline:none;color:var(--vp-c-white);background-color:var(--vp-c-sponsor)}.sp-icon[data-v-37dee882]{margin-right:8px;font-size:16px}.VPTeamMembers.small .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(224px,1fr))}.VPTeamMembers.small.count-1 .container[data-v-43ad829f]{max-width:276px}.VPTeamMembers.small.count-2 .container[data-v-43ad829f]{max-width:576px}.VPTeamMembers.small.count-3 .container[data-v-43ad829f]{max-width:876px}.VPTeamMembers.medium .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(256px,1fr))}@media (min-width: 375px){.VPTeamMembers.medium .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(288px,1fr))}}.VPTeamMembers.medium.count-1 .container[data-v-43ad829f]{max-width:368px}.VPTeamMembers.medium.count-2 .container[data-v-43ad829f]{max-width:760px}.container[data-v-43ad829f]{display:grid;gap:24px;margin:0 auto;max-width:1152px}:root{--vp-home-hero-name-color: transparent;--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff)}@media (min-width: 640px){:root{--vp-home-hero-image-filter: blur(56px)}}@media (min-width: 960px){:root{--vp-home-hero-image-filter: blur(68px)}} diff --git a/assets/style.C6qVLbET.css b/assets/style.C6qVLbET.css new file mode 100644 index 0000000..f59963a --- /dev/null +++ b/assets/style.C6qVLbET.css @@ -0,0 +1 @@ +:root{--vp-home-hero-name-color: transparent;--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff)}@media (min-width: 640px){:root{--vp-home-hero-image-filter: blur(56px)}}@media (min-width: 960px){:root{--vp-home-hero-image-filter: blur(68px)}}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic.C5lxZ8CY.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek-ext.CqjqNYQ-.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek.BBVDIX6e.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-vietnamese.BjW4sHH5.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin-ext.4ZJIpNVo.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin.Di8DUHzh.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic-ext.r48I6akx.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic.By2_1cv3.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek-ext.1u6EdAuj.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek.DJ8dCoTZ.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-vietnamese.BSbpV94h.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin-ext.CN1xVJS-.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin.C2AdPX0b.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Punctuation SC;font-weight:400;src:local("PingFang SC Regular"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:500;src:local("PingFang SC Medium"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:600;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:700;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}:root{--vp-c-white: #ffffff;--vp-c-black: #000000;--vp-c-neutral: var(--vp-c-black);--vp-c-neutral-inverse: var(--vp-c-white)}.dark{--vp-c-neutral: var(--vp-c-white);--vp-c-neutral-inverse: var(--vp-c-black)}:root{--vp-c-gray-1: #dddde3;--vp-c-gray-2: #e4e4e9;--vp-c-gray-3: #ebebef;--vp-c-gray-soft: rgba(142, 150, 170, .14);--vp-c-indigo-1: #3451b2;--vp-c-indigo-2: #3a5ccc;--vp-c-indigo-3: #5672cd;--vp-c-indigo-soft: rgba(100, 108, 255, .14);--vp-c-purple-1: #6f42c1;--vp-c-purple-2: #7e4cc9;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .14);--vp-c-green-1: #18794e;--vp-c-green-2: #299764;--vp-c-green-3: #30a46c;--vp-c-green-soft: rgba(16, 185, 129, .14);--vp-c-yellow-1: #915930;--vp-c-yellow-2: #946300;--vp-c-yellow-3: #9f6a00;--vp-c-yellow-soft: rgba(234, 179, 8, .14);--vp-c-red-1: #b8272c;--vp-c-red-2: #d5393e;--vp-c-red-3: #e0575b;--vp-c-red-soft: rgba(244, 63, 94, .14);--vp-c-sponsor: #db2777}.dark{--vp-c-gray-1: #515c67;--vp-c-gray-2: #414853;--vp-c-gray-3: #32363f;--vp-c-gray-soft: rgba(101, 117, 133, .16);--vp-c-indigo-1: #a8b1ff;--vp-c-indigo-2: #5c73e7;--vp-c-indigo-3: #3e63dd;--vp-c-indigo-soft: rgba(100, 108, 255, .16);--vp-c-purple-1: #c8abfa;--vp-c-purple-2: #a879e6;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .16);--vp-c-green-1: #3dd68c;--vp-c-green-2: #30a46c;--vp-c-green-3: #298459;--vp-c-green-soft: rgba(16, 185, 129, .16);--vp-c-yellow-1: #f9b44e;--vp-c-yellow-2: #da8b17;--vp-c-yellow-3: #a46a0a;--vp-c-yellow-soft: rgba(234, 179, 8, .16);--vp-c-red-1: #f66f81;--vp-c-red-2: #f14158;--vp-c-red-3: #b62a3c;--vp-c-red-soft: rgba(244, 63, 94, .16)}:root{--vp-c-bg: #ffffff;--vp-c-bg-alt: #f6f6f7;--vp-c-bg-elv: #ffffff;--vp-c-bg-soft: #f6f6f7}.dark{--vp-c-bg: #1b1b1f;--vp-c-bg-alt: #161618;--vp-c-bg-elv: #202127;--vp-c-bg-soft: #202127}:root{--vp-c-border: #c2c2c4;--vp-c-divider: #e2e2e3;--vp-c-gutter: #e2e2e3}.dark{--vp-c-border: #3c3f44;--vp-c-divider: #2e2e32;--vp-c-gutter: #000000}:root{--vp-c-text-1: rgba(60, 60, 67);--vp-c-text-2: rgba(60, 60, 67, .78);--vp-c-text-3: rgba(60, 60, 67, .56)}.dark{--vp-c-text-1: rgba(255, 255, 245, .86);--vp-c-text-2: rgba(235, 235, 245, .6);--vp-c-text-3: rgba(235, 235, 245, .38)}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-brand: var(--vp-c-brand-1);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-note-1: var(--vp-c-brand-1);--vp-c-note-2: var(--vp-c-brand-2);--vp-c-note-3: var(--vp-c-brand-3);--vp-c-note-soft: var(--vp-c-brand-soft);--vp-c-success-1: var(--vp-c-green-1);--vp-c-success-2: var(--vp-c-green-2);--vp-c-success-3: var(--vp-c-green-3);--vp-c-success-soft: var(--vp-c-green-soft);--vp-c-important-1: var(--vp-c-purple-1);--vp-c-important-2: var(--vp-c-purple-2);--vp-c-important-3: var(--vp-c-purple-3);--vp-c-important-soft: var(--vp-c-purple-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft);--vp-c-caution-1: var(--vp-c-red-1);--vp-c-caution-2: var(--vp-c-red-2);--vp-c-caution-3: var(--vp-c-red-3);--vp-c-caution-soft: var(--vp-c-red-soft)}:root{--vp-font-family-base: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--vp-font-family-mono: ui-monospace, "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}:root:where(:lang(zh)){--vp-font-family-base: "Punctuation SC", "Inter", ui-sans-serif, system-ui, "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Heiti SC", "Microsoft YaHei", "DengXian", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}:root{--vp-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--vp-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--vp-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--vp-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--vp-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)}:root{--vp-z-index-footer: 10;--vp-z-index-local-nav: 20;--vp-z-index-nav: 30;--vp-z-index-layout-top: 40;--vp-z-index-backdrop: 50;--vp-z-index-sidebar: 60}@media (min-width: 960px){:root{--vp-z-index-sidebar: 25}}:root{--vp-layout-max-width: 1440px}:root{--vp-header-anchor-symbol: "#"}:root{--vp-code-line-height: 1.7;--vp-code-font-size: .875em;--vp-code-color: var(--vp-c-brand-1);--vp-code-link-color: var(--vp-c-brand-1);--vp-code-link-hover-color: var(--vp-c-brand-2);--vp-code-bg: var(--vp-c-default-soft);--vp-code-block-color: var(--vp-c-text-2);--vp-code-block-bg: var(--vp-c-bg-alt);--vp-code-block-divider-color: var(--vp-c-gutter);--vp-code-lang-color: var(--vp-c-text-3);--vp-code-line-highlight-color: var(--vp-c-default-soft);--vp-code-line-number-color: var(--vp-c-text-3);--vp-code-line-diff-add-color: var(--vp-c-success-soft);--vp-code-line-diff-add-symbol-color: var(--vp-c-success-1);--vp-code-line-diff-remove-color: var(--vp-c-danger-soft);--vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1);--vp-code-line-warning-color: var(--vp-c-warning-soft);--vp-code-line-error-color: var(--vp-c-danger-soft);--vp-code-copy-code-border-color: var(--vp-c-divider);--vp-code-copy-code-bg: var(--vp-c-bg-soft);--vp-code-copy-code-hover-border-color: var(--vp-c-divider);--vp-code-copy-code-hover-bg: var(--vp-c-bg);--vp-code-copy-code-active-text: var(--vp-c-text-2);--vp-code-copy-copied-text-content: "Copied";--vp-code-tab-divider: var(--vp-code-block-divider-color);--vp-code-tab-text-color: var(--vp-c-text-2);--vp-code-tab-bg: var(--vp-code-block-bg);--vp-code-tab-hover-text-color: var(--vp-c-text-1);--vp-code-tab-active-text-color: var(--vp-c-text-1);--vp-code-tab-active-bar-color: var(--vp-c-brand-1)}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1);--vp-button-alt-border: transparent;--vp-button-alt-text: var(--vp-c-text-1);--vp-button-alt-bg: var(--vp-c-default-3);--vp-button-alt-hover-border: transparent;--vp-button-alt-hover-text: var(--vp-c-text-1);--vp-button-alt-hover-bg: var(--vp-c-default-2);--vp-button-alt-active-border: transparent;--vp-button-alt-active-text: var(--vp-c-text-1);--vp-button-alt-active-bg: var(--vp-c-default-1);--vp-button-sponsor-border: var(--vp-c-text-2);--vp-button-sponsor-text: var(--vp-c-text-2);--vp-button-sponsor-bg: transparent;--vp-button-sponsor-hover-border: var(--vp-c-sponsor);--vp-button-sponsor-hover-text: var(--vp-c-sponsor);--vp-button-sponsor-hover-bg: transparent;--vp-button-sponsor-active-border: var(--vp-c-sponsor);--vp-button-sponsor-active-text: var(--vp-c-sponsor);--vp-button-sponsor-active-bg: transparent}:root{--vp-custom-block-font-size: 14px;--vp-custom-block-code-font-size: 13px;--vp-custom-block-info-border: transparent;--vp-custom-block-info-text: var(--vp-c-text-1);--vp-custom-block-info-bg: var(--vp-c-default-soft);--vp-custom-block-info-code-bg: var(--vp-c-default-soft);--vp-custom-block-note-border: transparent;--vp-custom-block-note-text: var(--vp-c-text-1);--vp-custom-block-note-bg: var(--vp-c-default-soft);--vp-custom-block-note-code-bg: var(--vp-c-default-soft);--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-tip-soft);--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);--vp-custom-block-important-border: transparent;--vp-custom-block-important-text: var(--vp-c-text-1);--vp-custom-block-important-bg: var(--vp-c-important-soft);--vp-custom-block-important-code-bg: var(--vp-c-important-soft);--vp-custom-block-warning-border: transparent;--vp-custom-block-warning-text: var(--vp-c-text-1);--vp-custom-block-warning-bg: var(--vp-c-warning-soft);--vp-custom-block-warning-code-bg: var(--vp-c-warning-soft);--vp-custom-block-danger-border: transparent;--vp-custom-block-danger-text: var(--vp-c-text-1);--vp-custom-block-danger-bg: var(--vp-c-danger-soft);--vp-custom-block-danger-code-bg: var(--vp-c-danger-soft);--vp-custom-block-caution-border: transparent;--vp-custom-block-caution-text: var(--vp-c-text-1);--vp-custom-block-caution-bg: var(--vp-c-caution-soft);--vp-custom-block-caution-code-bg: var(--vp-c-caution-soft);--vp-custom-block-details-border: var(--vp-custom-block-info-border);--vp-custom-block-details-text: var(--vp-custom-block-info-text);--vp-custom-block-details-bg: var(--vp-custom-block-info-bg);--vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg)}:root{--vp-input-border-color: var(--vp-c-border);--vp-input-bg-color: var(--vp-c-bg-alt);--vp-input-switch-bg-color: var(--vp-c-default-soft)}:root{--vp-nav-height: 64px;--vp-nav-bg-color: var(--vp-c-bg);--vp-nav-screen-bg-color: var(--vp-c-bg);--vp-nav-logo-height: 24px}.hide-nav{--vp-nav-height: 0px}.hide-nav .VPSidebar{--vp-nav-height: 22px}:root{--vp-local-nav-bg-color: var(--vp-c-bg)}:root{--vp-sidebar-width: 272px;--vp-sidebar-bg-color: var(--vp-c-bg-alt)}:root{--vp-backdrop-bg-color: rgba(0, 0, 0, .6)}:root{--vp-home-hero-name-color: var(--vp-c-brand-1);--vp-home-hero-name-background: transparent;--vp-home-hero-image-background-image: none;--vp-home-hero-image-filter: none}:root{--vp-badge-info-border: transparent;--vp-badge-info-text: var(--vp-c-text-2);--vp-badge-info-bg: var(--vp-c-default-soft);--vp-badge-tip-border: transparent;--vp-badge-tip-text: var(--vp-c-tip-1);--vp-badge-tip-bg: var(--vp-c-tip-soft);--vp-badge-warning-border: transparent;--vp-badge-warning-text: var(--vp-c-warning-1);--vp-badge-warning-bg: var(--vp-c-warning-soft);--vp-badge-danger-border: transparent;--vp-badge-danger-text: var(--vp-c-danger-1);--vp-badge-danger-bg: var(--vp-c-danger-soft)}:root{--vp-carbon-ads-text-color: var(--vp-c-text-1);--vp-carbon-ads-poweredby-color: var(--vp-c-text-2);--vp-carbon-ads-bg-color: var(--vp-c-bg-soft);--vp-carbon-ads-hover-text-color: var(--vp-c-brand-1);--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1)}:root{--vp-local-search-bg: var(--vp-c-bg);--vp-local-search-result-bg: var(--vp-c-bg);--vp-local-search-result-border: var(--vp-c-divider);--vp-local-search-result-selected-bg: var(--vp-c-bg);--vp-local-search-result-selected-border: var(--vp-c-brand-1);--vp-local-search-highlight-bg: var(--vp-c-brand-1);--vp-local-search-highlight-text: var(--vp-c-neutral-inverse)}@media (prefers-reduced-motion: reduce){*,:before,:after{animation-delay:-1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important;background-attachment:initial!important;scroll-behavior:auto!important;transition-duration:0s!important;transition-delay:0s!important}}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}html.dark{color-scheme:dark}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:24px;font-family:var(--vp-font-family-base);font-size:16px;font-weight:400;color:var(--vp-c-text-1);background-color:var(--vp-c-bg);font-synthesis:style;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:24px;font-size:16px;font-weight:400}p{margin:0}strong,b{font-weight:600}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{color:inherit;text-decoration:inherit}ol,ul{list-style:none;margin:0;padding:0}blockquote{margin:0}pre,code,kbd,samp{font-family:var(--vp-font-family-mono)}img,svg,video,canvas,audio,iframe,embed,object{display:block}figure{margin:0}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{border:0;padding:0;line-height:inherit;color:inherit}button{padding:0;font-family:inherit;background-color:transparent;background-image:none}button:enabled,[role=button]:enabled{cursor:pointer}button:focus,button:focus-visible{outline:1px dotted;outline:4px auto -webkit-focus-ring-color}button:focus:not(:focus-visible){outline:none!important}input:focus,textarea:focus,select:focus{outline:none}table{border-collapse:collapse}input{background-color:transparent}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--vp-c-text-3)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--vp-c-text-3)}input::placeholder,textarea::placeholder{color:var(--vp-c-text-3)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}textarea{resize:vertical}select{-webkit-appearance:none}fieldset{margin:0;padding:0}h1,h2,h3,h4,h5,h6,li,p{overflow-wrap:break-word}vite-error-overlay{z-index:9999}mjx-container{overflow-x:auto}mjx-container>svg{display:inline-block;margin:auto}[class^=vpi-],[class*=" vpi-"],.vp-icon{width:1em;height:1em}[class^=vpi-].bg,[class*=" vpi-"].bg,.vp-icon.bg{background-size:100% 100%;background-color:transparent}[class^=vpi-]:not(.bg),[class*=" vpi-"]:not(.bg),.vp-icon:not(.bg){-webkit-mask:var(--icon) no-repeat;mask:var(--icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit}.vpi-align-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E")}.vpi-arrow-right,.vpi-arrow-down,.vpi-arrow-left,.vpi-arrow-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E")}.vpi-chevron-right,.vpi-chevron-down,.vpi-chevron-left,.vpi-chevron-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}.vpi-chevron-down,.vpi-arrow-down{transform:rotate(90deg)}.vpi-chevron-left,.vpi-arrow-left{transform:rotate(180deg)}.vpi-chevron-up,.vpi-arrow-up{transform:rotate(-90deg)}.vpi-square-pen{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E")}.vpi-plus{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E")}.vpi-sun{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E")}.vpi-moon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E")}.vpi-more-horizontal{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E")}.vpi-languages{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E")}.vpi-heart{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E")}.vpi-search{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}.vpi-layout-list{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E")}.vpi-delete{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E")}.vpi-corner-down-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E")}:root{--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E")}.vpi-social-discord{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z'/%3E%3C/svg%3E")}.vpi-social-facebook{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z'/%3E%3C/svg%3E")}.vpi-social-github{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}.vpi-social-instagram{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.03.084c-1.277.06-2.149.264-2.91.563a5.874 5.874 0 0 0-2.124 1.388 5.878 5.878 0 0 0-1.38 2.127C.321 4.926.12 5.8.064 7.076.008 8.354-.005 8.764.001 12.023c.007 3.259.021 3.667.083 4.947.061 1.277.264 2.149.563 2.911.308.789.72 1.457 1.388 2.123a5.872 5.872 0 0 0 2.129 1.38c.763.295 1.636.496 2.913.552 1.278.056 1.689.069 4.947.063 3.257-.007 3.668-.021 4.947-.082 1.28-.06 2.147-.265 2.91-.563a5.881 5.881 0 0 0 2.123-1.388 5.881 5.881 0 0 0 1.38-2.129c.295-.763.496-1.636.551-2.912.056-1.28.07-1.69.063-4.948-.006-3.258-.02-3.667-.081-4.947-.06-1.28-.264-2.148-.564-2.911a5.892 5.892 0 0 0-1.387-2.123 5.857 5.857 0 0 0-2.128-1.38C19.074.322 18.202.12 16.924.066 15.647.009 15.236-.006 11.977 0 8.718.008 8.31.021 7.03.084m.14 21.693c-1.17-.05-1.805-.245-2.228-.408a3.736 3.736 0 0 1-1.382-.895 3.695 3.695 0 0 1-.9-1.378c-.165-.423-.363-1.058-.417-2.228-.06-1.264-.072-1.644-.08-4.848-.006-3.204.006-3.583.061-4.848.05-1.169.246-1.805.408-2.228.216-.561.477-.96.895-1.382a3.705 3.705 0 0 1 1.379-.9c.423-.165 1.057-.361 2.227-.417 1.265-.06 1.644-.072 4.848-.08 3.203-.006 3.583.006 4.85.062 1.168.05 1.804.244 2.227.408.56.216.96.475 1.382.895.421.42.681.817.9 1.378.165.422.362 1.056.417 2.227.06 1.265.074 1.645.08 4.848.005 3.203-.006 3.583-.061 4.848-.051 1.17-.245 1.805-.408 2.23-.216.56-.477.96-.896 1.38a3.705 3.705 0 0 1-1.378.9c-.422.165-1.058.362-2.226.418-1.266.06-1.645.072-4.85.079-3.204.007-3.582-.006-4.848-.06m9.783-16.192a1.44 1.44 0 1 0 1.437-1.442 1.44 1.44 0 0 0-1.437 1.442M5.839 12.012a6.161 6.161 0 1 0 12.323-.024 6.162 6.162 0 0 0-12.323.024M8 12.008A4 4 0 1 1 12.008 16 4 4 0 0 1 8 12.008'/%3E%3C/svg%3E")}.vpi-social-linkedin{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E")}.vpi-social-mastodon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z'/%3E%3C/svg%3E")}.vpi-social-npm{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z'/%3E%3C/svg%3E")}.vpi-social-slack{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z'/%3E%3C/svg%3E")}.vpi-social-twitter,.vpi-social-x{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E")}.vpi-social-youtube{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E")}.visually-hidden{position:absolute;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden}.custom-block{border:1px solid transparent;border-radius:8px;padding:16px 16px 8px;line-height:24px;font-size:var(--vp-custom-block-font-size);color:var(--vp-c-text-2)}.custom-block.info{border-color:var(--vp-custom-block-info-border);color:var(--vp-custom-block-info-text);background-color:var(--vp-custom-block-info-bg)}.custom-block.info a,.custom-block.info code{color:var(--vp-c-brand-1)}.custom-block.info a:hover,.custom-block.info a:hover>code{color:var(--vp-c-brand-2)}.custom-block.info code{background-color:var(--vp-custom-block-info-code-bg)}.custom-block.note{border-color:var(--vp-custom-block-note-border);color:var(--vp-custom-block-note-text);background-color:var(--vp-custom-block-note-bg)}.custom-block.note a,.custom-block.note code{color:var(--vp-c-brand-1)}.custom-block.note a:hover,.custom-block.note a:hover>code{color:var(--vp-c-brand-2)}.custom-block.note code{background-color:var(--vp-custom-block-note-code-bg)}.custom-block.tip{border-color:var(--vp-custom-block-tip-border);color:var(--vp-custom-block-tip-text);background-color:var(--vp-custom-block-tip-bg)}.custom-block.tip a,.custom-block.tip code{color:var(--vp-c-tip-1)}.custom-block.tip a:hover,.custom-block.tip a:hover>code{color:var(--vp-c-tip-2)}.custom-block.tip code{background-color:var(--vp-custom-block-tip-code-bg)}.custom-block.important{border-color:var(--vp-custom-block-important-border);color:var(--vp-custom-block-important-text);background-color:var(--vp-custom-block-important-bg)}.custom-block.important a,.custom-block.important code{color:var(--vp-c-important-1)}.custom-block.important a:hover,.custom-block.important a:hover>code{color:var(--vp-c-important-2)}.custom-block.important code{background-color:var(--vp-custom-block-important-code-bg)}.custom-block.warning{border-color:var(--vp-custom-block-warning-border);color:var(--vp-custom-block-warning-text);background-color:var(--vp-custom-block-warning-bg)}.custom-block.warning a,.custom-block.warning code{color:var(--vp-c-warning-1)}.custom-block.warning a:hover,.custom-block.warning a:hover>code{color:var(--vp-c-warning-2)}.custom-block.warning code{background-color:var(--vp-custom-block-warning-code-bg)}.custom-block.danger{border-color:var(--vp-custom-block-danger-border);color:var(--vp-custom-block-danger-text);background-color:var(--vp-custom-block-danger-bg)}.custom-block.danger a,.custom-block.danger code{color:var(--vp-c-danger-1)}.custom-block.danger a:hover,.custom-block.danger a:hover>code{color:var(--vp-c-danger-2)}.custom-block.danger code{background-color:var(--vp-custom-block-danger-code-bg)}.custom-block.caution{border-color:var(--vp-custom-block-caution-border);color:var(--vp-custom-block-caution-text);background-color:var(--vp-custom-block-caution-bg)}.custom-block.caution a,.custom-block.caution code{color:var(--vp-c-caution-1)}.custom-block.caution a:hover,.custom-block.caution a:hover>code{color:var(--vp-c-caution-2)}.custom-block.caution code{background-color:var(--vp-custom-block-caution-code-bg)}.custom-block.details{border-color:var(--vp-custom-block-details-border);color:var(--vp-custom-block-details-text);background-color:var(--vp-custom-block-details-bg)}.custom-block.details a{color:var(--vp-c-brand-1)}.custom-block.details a:hover,.custom-block.details a:hover>code{color:var(--vp-c-brand-2)}.custom-block.details code{background-color:var(--vp-custom-block-details-code-bg)}.custom-block-title{font-weight:600}.custom-block p+p{margin:8px 0}.custom-block.details summary{margin:0 0 8px;font-weight:700;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-block.details summary+p{margin:8px 0}.custom-block a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;transition:opacity .25s}.custom-block a:hover{opacity:.75}.custom-block code{font-size:var(--vp-custom-block-code-font-size)}.custom-block.custom-block th,.custom-block.custom-block blockquote>p{font-size:var(--vp-custom-block-font-size);color:inherit}.dark .vp-code span{color:var(--shiki-dark, inherit)}html:not(.dark) .vp-code span{color:var(--shiki-light, inherit)}.vp-code-group{margin-top:16px}.vp-code-group .tabs{position:relative;display:flex;margin-right:-24px;margin-left:-24px;padding:0 12px;background-color:var(--vp-code-tab-bg);overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px var(--vp-code-tab-divider)}@media (min-width: 640px){.vp-code-group .tabs{margin-right:0;margin-left:0;border-radius:8px 8px 0 0}}.vp-code-group .tabs input{position:fixed;opacity:0;pointer-events:none}.vp-code-group .tabs label{position:relative;display:inline-block;border-bottom:1px solid transparent;padding:0 12px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-code-tab-text-color);white-space:nowrap;cursor:pointer;transition:color .25s}.vp-code-group .tabs label:after{position:absolute;right:8px;bottom:-1px;left:8px;z-index:1;height:2px;border-radius:2px;content:"";background-color:transparent;transition:background-color .25s}.vp-code-group label:hover{color:var(--vp-code-tab-hover-text-color)}.vp-code-group input:checked+label{color:var(--vp-code-tab-active-text-color)}.vp-code-group input:checked+label:after{background-color:var(--vp-code-tab-active-bar-color)}.vp-code-group div[class*=language-],.vp-block{display:none;margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.vp-code-group div[class*=language-].active,.vp-block.active{display:block}.vp-block{padding:20px 24px}.vp-doc h1,.vp-doc h2,.vp-doc h3,.vp-doc h4,.vp-doc h5,.vp-doc h6{position:relative;font-weight:600;outline:none}.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:28px}.vp-doc h2{margin:48px 0 16px;border-top:1px solid var(--vp-c-divider);padding-top:24px;letter-spacing:-.02em;line-height:32px;font-size:24px}.vp-doc h3{margin:32px 0 0;letter-spacing:-.01em;line-height:28px;font-size:20px}.vp-doc h4{margin:24px 0 0;letter-spacing:-.01em;line-height:24px;font-size:18px}.vp-doc .header-anchor{position:absolute;top:0;left:0;margin-left:-.87em;font-weight:500;-webkit-user-select:none;user-select:none;opacity:0;text-decoration:none;transition:color .25s,opacity .25s}.vp-doc .header-anchor:before{content:var(--vp-header-anchor-symbol)}.vp-doc h1:hover .header-anchor,.vp-doc h1 .header-anchor:focus,.vp-doc h2:hover .header-anchor,.vp-doc h2 .header-anchor:focus,.vp-doc h3:hover .header-anchor,.vp-doc h3 .header-anchor:focus,.vp-doc h4:hover .header-anchor,.vp-doc h4 .header-anchor:focus,.vp-doc h5:hover .header-anchor,.vp-doc h5 .header-anchor:focus,.vp-doc h6:hover .header-anchor,.vp-doc h6 .header-anchor:focus{opacity:1}@media (min-width: 768px){.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:32px}}.vp-doc h2 .header-anchor{top:24px}.vp-doc p,.vp-doc summary{margin:16px 0}.vp-doc p{line-height:28px}.vp-doc blockquote{margin:16px 0;border-left:2px solid var(--vp-c-divider);padding-left:16px;transition:border-color .5s;color:var(--vp-c-text-2)}.vp-doc blockquote>p{margin:0;font-size:16px;transition:color .5s}.vp-doc a{font-weight:500;color:var(--vp-c-brand-1);text-decoration:underline;text-underline-offset:2px;transition:color .25s,opacity .25s}.vp-doc a:hover{color:var(--vp-c-brand-2)}.vp-doc strong{font-weight:600}.vp-doc ul,.vp-doc ol{padding-left:1.25rem;margin:16px 0}.vp-doc ul{list-style:disc}.vp-doc ol{list-style:decimal}.vp-doc li+li{margin-top:8px}.vp-doc li>ol,.vp-doc li>ul{margin:8px 0 0}.vp-doc table{display:block;border-collapse:collapse;margin:20px 0;overflow-x:auto}.vp-doc tr{background-color:var(--vp-c-bg);border-top:1px solid var(--vp-c-divider);transition:background-color .5s}.vp-doc tr:nth-child(2n){background-color:var(--vp-c-bg-soft)}.vp-doc th,.vp-doc td{border:1px solid var(--vp-c-divider);padding:8px 16px}.vp-doc th{text-align:left;font-size:14px;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-doc td{font-size:14px}.vp-doc hr{margin:16px 0;border:none;border-top:1px solid var(--vp-c-divider)}.vp-doc .custom-block{margin:16px 0}.vp-doc .custom-block p{margin:8px 0;line-height:24px}.vp-doc .custom-block p:first-child{margin:0}.vp-doc .custom-block div[class*=language-]{margin:8px 0;border-radius:8px}.vp-doc .custom-block div[class*=language-] code{font-weight:400;background-color:transparent}.vp-doc .custom-block .vp-code-group .tabs{margin:0;border-radius:8px 8px 0 0}.vp-doc :not(pre,h1,h2,h3,h4,h5,h6)>code{font-size:var(--vp-code-font-size);color:var(--vp-code-color)}.vp-doc :not(pre)>code{border-radius:4px;padding:3px 6px;background-color:var(--vp-code-bg);transition:color .25s,background-color .5s}.vp-doc a>code{color:var(--vp-code-link-color)}.vp-doc a:hover>code{color:var(--vp-code-link-hover-color)}.vp-doc h1>code,.vp-doc h2>code,.vp-doc h3>code,.vp-doc h4>code{font-size:.9em}.vp-doc div[class*=language-],.vp-block{position:relative;margin:16px -24px;background-color:var(--vp-code-block-bg);overflow-x:auto;transition:background-color .5s}@media (min-width: 640px){.vp-doc div[class*=language-],.vp-block{border-radius:8px;margin:16px 0}}@media (max-width: 639px){.vp-doc li div[class*=language-]{border-radius:8px 0 0 8px}}.vp-doc div[class*=language-]+div[class*=language-],.vp-doc div[class$=-api]+div[class*=language-],.vp-doc div[class*=language-]+div[class$=-api]>div[class*=language-]{margin-top:-8px}.vp-doc [class*=language-] pre,.vp-doc [class*=language-] code{direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.vp-doc [class*=language-] pre{position:relative;z-index:1;margin:0;padding:20px 0;background:transparent;overflow-x:auto}.vp-doc [class*=language-] code{display:block;padding:0 24px;width:fit-content;min-width:100%;line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-block-color);transition:color .5s}.vp-doc [class*=language-] code .highlighted{background-color:var(--vp-code-line-highlight-color);transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .highlighted.error{background-color:var(--vp-code-line-error-color)}.vp-doc [class*=language-] code .highlighted.warning{background-color:var(--vp-code-line-warning-color)}.vp-doc [class*=language-] code .diff{transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .diff:before{position:absolute;left:10px}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){filter:blur(.095rem);opacity:.4;transition:filter .35s,opacity .35s}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){opacity:.7;transition:filter .35s,opacity .35s}.vp-doc [class*=language-]:hover .has-focused-lines .line:not(.has-focus){filter:blur(0);opacity:1}.vp-doc [class*=language-] code .diff.remove{background-color:var(--vp-code-line-diff-remove-color);opacity:.7}.vp-doc [class*=language-] code .diff.remove:before{content:"-";color:var(--vp-code-line-diff-remove-symbol-color)}.vp-doc [class*=language-] code .diff.add{background-color:var(--vp-code-line-diff-add-color)}.vp-doc [class*=language-] code .diff.add:before{content:"+";color:var(--vp-code-line-diff-add-symbol-color)}.vp-doc div[class*=language-].line-numbers-mode{padding-left:32px}.vp-doc .line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid var(--vp-code-block-divider-color);padding-top:20px;width:32px;text-align:center;font-family:var(--vp-font-family-mono);line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-line-number-color);transition:border-color .5s,color .5s}.vp-doc [class*=language-]>button.copy{direction:ltr;position:absolute;top:12px;right:12px;z-index:3;border:1px solid var(--vp-code-copy-code-border-color);border-radius:4px;width:40px;height:40px;background-color:var(--vp-code-copy-code-bg);opacity:0;cursor:pointer;background-image:var(--vp-icon-copy);background-position:50%;background-size:20px;background-repeat:no-repeat;transition:border-color .25s,background-color .25s,opacity .25s}.vp-doc [class*=language-]:hover>button.copy,.vp-doc [class*=language-]>button.copy:focus{opacity:1}.vp-doc [class*=language-]>button.copy:hover,.vp-doc [class*=language-]>button.copy.copied{border-color:var(--vp-code-copy-code-hover-border-color);background-color:var(--vp-code-copy-code-hover-bg)}.vp-doc [class*=language-]>button.copy.copied,.vp-doc [class*=language-]>button.copy:hover.copied{border-radius:0 4px 4px 0;background-color:var(--vp-code-copy-code-hover-bg);background-image:var(--vp-icon-copied)}.vp-doc [class*=language-]>button.copy.copied:before,.vp-doc [class*=language-]>button.copy:hover.copied:before{position:relative;top:-1px;transform:translate(calc(-100% - 1px));display:flex;justify-content:center;align-items:center;border:1px solid var(--vp-code-copy-code-hover-border-color);border-right:0;border-radius:4px 0 0 4px;padding:0 10px;width:fit-content;height:40px;text-align:center;font-size:12px;font-weight:500;color:var(--vp-code-copy-code-active-text);background-color:var(--vp-code-copy-code-hover-bg);white-space:nowrap;content:var(--vp-code-copy-copied-text-content)}.vp-doc [class*=language-]>span.lang{position:absolute;top:2px;right:8px;z-index:2;font-size:12px;font-weight:500;color:var(--vp-code-lang-color);transition:color .4s,opacity .4s}.vp-doc [class*=language-]:hover>button.copy+span.lang,.vp-doc [class*=language-]>button.copy:focus+span.lang{opacity:0}.vp-doc .VPTeamMembers{margin-top:24px}.vp-doc .VPTeamMembers.small.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}.vp-doc .VPTeamMembers.small.count-2 .container,.vp-doc .VPTeamMembers.small.count-3 .container{max-width:100%!important}.vp-doc .VPTeamMembers.medium.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}:is(.vp-external-link-icon,.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(.no-icon):after{display:inline-block;margin-top:-1px;margin-left:4px;width:11px;height:11px;background:currentColor;color:var(--vp-c-text-3);flex-shrink:0;--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");-webkit-mask-image:var(--icon);mask-image:var(--icon)}.vp-external-link-icon:after{content:""}.external-link-icon-enabled :is(.vp-doc a[href*="://"],.vp-doc a[target=_blank]):after{content:"";color:currentColor}.vp-sponsor{border-radius:16px;overflow:hidden}.vp-sponsor.aside{border-radius:12px}.vp-sponsor-section+.vp-sponsor-section{margin-top:4px}.vp-sponsor-tier{margin:0 0 4px!important;text-align:center;letter-spacing:1px!important;line-height:24px;width:100%;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-sponsor.normal .vp-sponsor-tier{padding:13px 0 11px;font-size:14px}.vp-sponsor.aside .vp-sponsor-tier{padding:9px 0 7px;font-size:12px}.vp-sponsor-grid+.vp-sponsor-tier{margin-top:4px}.vp-sponsor-grid{display:flex;flex-wrap:wrap;gap:4px}.vp-sponsor-grid.xmini .vp-sponsor-grid-link{height:64px}.vp-sponsor-grid.xmini .vp-sponsor-grid-image{max-width:64px;max-height:22px}.vp-sponsor-grid.mini .vp-sponsor-grid-link{height:72px}.vp-sponsor-grid.mini .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.small .vp-sponsor-grid-link{height:96px}.vp-sponsor-grid.small .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.medium .vp-sponsor-grid-link{height:112px}.vp-sponsor-grid.medium .vp-sponsor-grid-image{max-width:120px;max-height:36px}.vp-sponsor-grid.big .vp-sponsor-grid-link{height:184px}.vp-sponsor-grid.big .vp-sponsor-grid-image{max-width:192px;max-height:56px}.vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item{width:calc((100% - 4px)/2)}.vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item{width:calc((100% - 4px * 2) / 3)}.vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item{width:calc((100% - 12px)/4)}.vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item{width:calc((100% - 16px)/5)}.vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item{width:calc((100% - 4px * 5) / 6)}.vp-sponsor-grid-item{flex-shrink:0;width:100%;background-color:var(--vp-c-bg-soft);transition:background-color .25s}.vp-sponsor-grid-item:hover{background-color:var(--vp-c-default-soft)}.vp-sponsor-grid-item:hover .vp-sponsor-grid-image{filter:grayscale(0) invert(0)}.vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.dark .vp-sponsor-grid-item:hover{background-color:var(--vp-c-white)}.dark .vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.vp-sponsor-grid-link{display:flex}.vp-sponsor-grid-box{display:flex;justify-content:center;align-items:center;width:100%}.vp-sponsor-grid-image{max-width:100%;filter:grayscale(1);transition:filter .25s}.dark .vp-sponsor-grid-image{filter:grayscale(1) invert(1)}.VPBadge{display:inline-block;margin-left:2px;border:1px solid transparent;border-radius:12px;padding:0 10px;line-height:22px;font-size:12px;font-weight:500;transform:translateY(-2px)}.VPBadge.small{padding:0 6px;line-height:18px;font-size:10px;transform:translateY(-8px)}.VPDocFooter .VPBadge{display:none}.vp-doc h1>.VPBadge{margin-top:4px;vertical-align:top}.vp-doc h2>.VPBadge{margin-top:3px;padding:0 8px;vertical-align:top}.vp-doc h3>.VPBadge{vertical-align:middle}.vp-doc h4>.VPBadge,.vp-doc h5>.VPBadge,.vp-doc h6>.VPBadge{vertical-align:middle;line-height:18px}.VPBadge.info{border-color:var(--vp-badge-info-border);color:var(--vp-badge-info-text);background-color:var(--vp-badge-info-bg)}.VPBadge.tip{border-color:var(--vp-badge-tip-border);color:var(--vp-badge-tip-text);background-color:var(--vp-badge-tip-bg)}.VPBadge.warning{border-color:var(--vp-badge-warning-border);color:var(--vp-badge-warning-text);background-color:var(--vp-badge-warning-bg)}.VPBadge.danger{border-color:var(--vp-badge-danger-border);color:var(--vp-badge-danger-text);background-color:var(--vp-badge-danger-bg)}.VPBackdrop[data-v-20b1d393]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vp-z-index-backdrop);background:var(--vp-backdrop-bg-color);transition:opacity .5s}.VPBackdrop.fade-enter-from[data-v-20b1d393],.VPBackdrop.fade-leave-to[data-v-20b1d393]{opacity:0}.VPBackdrop.fade-leave-active[data-v-20b1d393]{transition-duration:.25s}@media (min-width: 1280px){.VPBackdrop[data-v-20b1d393]{display:none}}.NotFound[data-v-21980364]{padding:64px 24px 96px;text-align:center}@media (min-width: 768px){.NotFound[data-v-21980364]{padding:96px 32px 168px}}.code[data-v-21980364]{line-height:64px;font-size:64px;font-weight:600}.title[data-v-21980364]{padding-top:12px;letter-spacing:2px;line-height:20px;font-size:20px;font-weight:700}.divider[data-v-21980364]{margin:24px auto 18px;width:64px;height:1px;background-color:var(--vp-c-divider)}.quote[data-v-21980364]{margin:0 auto;max-width:256px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.action[data-v-21980364]{padding-top:20px}.link[data-v-21980364]{display:inline-block;border:1px solid var(--vp-c-brand-1);border-radius:16px;padding:3px 16px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:border-color .25s,color .25s}.link[data-v-21980364]:hover{border-color:var(--vp-c-brand-2);color:var(--vp-c-brand-2)}.root[data-v-51c2c770]{position:relative;z-index:1}.nested[data-v-51c2c770]{padding-right:16px;padding-left:16px}.outline-link[data-v-51c2c770]{display:block;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .5s}.outline-link[data-v-51c2c770]:hover,.outline-link.active[data-v-51c2c770]{color:var(--vp-c-text-1);transition:color .25s}.outline-link.nested[data-v-51c2c770]{padding-left:13px}.VPDocAsideOutline[data-v-e7b12e6e]{display:none}.VPDocAsideOutline.has-outline[data-v-e7b12e6e]{display:block}.content[data-v-e7b12e6e]{position:relative;border-left:1px solid var(--vp-c-divider);padding-left:16px;font-size:13px;font-weight:500}.outline-marker[data-v-e7b12e6e]{position:absolute;top:32px;left:-1px;z-index:0;opacity:0;width:2px;border-radius:2px;height:18px;background-color:var(--vp-c-brand-1);transition:top .25s cubic-bezier(0,1,.5,1),background-color .5s,opacity .25s}.outline-title[data-v-e7b12e6e]{line-height:32px;font-size:14px;font-weight:600}.VPDocAside[data-v-0ff3c77f]{display:flex;flex-direction:column;flex-grow:1}.spacer[data-v-0ff3c77f]{flex-grow:1}.VPDocAside[data-v-0ff3c77f] .spacer+.VPDocAsideSponsors,.VPDocAside[data-v-0ff3c77f] .spacer+.VPDocAsideCarbonAds{margin-top:24px}.VPDocAside[data-v-0ff3c77f] .VPDocAsideSponsors+.VPDocAsideCarbonAds{margin-top:16px}.VPLastUpdated[data-v-5cebc0fc]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 640px){.VPLastUpdated[data-v-5cebc0fc]{line-height:32px;font-size:14px;font-weight:500}}.VPDocFooter[data-v-a4b38bd6]{margin-top:64px}.edit-info[data-v-a4b38bd6]{padding-bottom:18px}@media (min-width: 640px){.edit-info[data-v-a4b38bd6]{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}.edit-link-button[data-v-a4b38bd6]{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.edit-link-button[data-v-a4b38bd6]:hover{color:var(--vp-c-brand-2)}.edit-link-icon[data-v-a4b38bd6]{margin-right:8px}.prev-next[data-v-a4b38bd6]{border-top:1px solid var(--vp-c-divider);padding-top:24px;display:grid;grid-row-gap:8px}@media (min-width: 640px){.prev-next[data-v-a4b38bd6]{grid-template-columns:repeat(2,1fr);grid-column-gap:16px}}.pager-link[data-v-a4b38bd6]{display:block;border:1px solid var(--vp-c-divider);border-radius:8px;padding:11px 16px 13px;width:100%;height:100%;transition:border-color .25s}.pager-link[data-v-a4b38bd6]:hover{border-color:var(--vp-c-brand-1)}.pager-link.next[data-v-a4b38bd6]{margin-left:auto;text-align:right}.desc[data-v-a4b38bd6]{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.title[data-v-a4b38bd6]{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.VPDoc[data-v-40342069]{padding:32px 24px 96px;width:100%}@media (min-width: 768px){.VPDoc[data-v-40342069]{padding:48px 32px 128px}}@media (min-width: 960px){.VPDoc[data-v-40342069]{padding:48px 32px 0}.VPDoc:not(.has-sidebar) .container[data-v-40342069]{display:flex;justify-content:center;max-width:992px}.VPDoc:not(.has-sidebar) .content[data-v-40342069]{max-width:752px}}@media (min-width: 1280px){.VPDoc .container[data-v-40342069]{display:flex;justify-content:center}.VPDoc .aside[data-v-40342069]{display:block}}@media (min-width: 1440px){.VPDoc:not(.has-sidebar) .content[data-v-40342069]{max-width:784px}.VPDoc:not(.has-sidebar) .container[data-v-40342069]{max-width:1104px}}.container[data-v-40342069]{margin:0 auto;width:100%}.aside[data-v-40342069]{position:relative;display:none;order:2;flex-grow:1;padding-left:32px;width:100%;max-width:256px}.left-aside[data-v-40342069]{order:1;padding-left:unset;padding-right:32px}.aside-container[data-v-40342069]{position:fixed;top:0;padding-top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px);width:224px;height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}.aside-container[data-v-40342069]::-webkit-scrollbar{display:none}.aside-curtain[data-v-40342069]{position:fixed;bottom:0;z-index:10;width:224px;height:32px;background:linear-gradient(transparent,var(--vp-c-bg) 70%)}.aside-content[data-v-40342069]{display:flex;flex-direction:column;min-height:calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px));padding-bottom:32px}.content[data-v-40342069]{position:relative;margin:0 auto;width:100%}@media (min-width: 960px){.content[data-v-40342069]{padding:0 32px 128px}}@media (min-width: 1280px){.content[data-v-40342069]{order:1;margin:0;min-width:640px}}.content-container[data-v-40342069]{margin:0 auto}.VPDoc.has-aside .content-container[data-v-40342069]{max-width:688px}.VPButton[data-v-885c6978]{display:inline-block;border:1px solid transparent;text-align:center;font-weight:600;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s}.VPButton[data-v-885c6978]:active{transition:color .1s,border-color .1s,background-color .1s}.VPButton.medium[data-v-885c6978]{border-radius:20px;padding:0 20px;line-height:38px;font-size:14px}.VPButton.big[data-v-885c6978]{border-radius:24px;padding:0 24px;line-height:46px;font-size:16px}.VPButton.brand[data-v-885c6978]{border-color:var(--vp-button-brand-border);color:var(--vp-button-brand-text);background-color:var(--vp-button-brand-bg)}.VPButton.brand[data-v-885c6978]:hover{border-color:var(--vp-button-brand-hover-border);color:var(--vp-button-brand-hover-text);background-color:var(--vp-button-brand-hover-bg)}.VPButton.brand[data-v-885c6978]:active{border-color:var(--vp-button-brand-active-border);color:var(--vp-button-brand-active-text);background-color:var(--vp-button-brand-active-bg)}.VPButton.alt[data-v-885c6978]{border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.VPButton.alt[data-v-885c6978]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.VPButton.alt[data-v-885c6978]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.VPButton.sponsor[data-v-885c6978]{border-color:var(--vp-button-sponsor-border);color:var(--vp-button-sponsor-text);background-color:var(--vp-button-sponsor-bg)}.VPButton.sponsor[data-v-885c6978]:hover{border-color:var(--vp-button-sponsor-hover-border);color:var(--vp-button-sponsor-hover-text);background-color:var(--vp-button-sponsor-hover-bg)}.VPButton.sponsor[data-v-885c6978]:active{border-color:var(--vp-button-sponsor-active-border);color:var(--vp-button-sponsor-active-text);background-color:var(--vp-button-sponsor-active-bg)}html:not(.dark) .VPImage.dark[data-v-f925500d]{display:none}.dark .VPImage.light[data-v-f925500d]{display:none}.VPHero[data-v-325add7b]{margin-top:calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px}@media (min-width: 640px){.VPHero[data-v-325add7b]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px}}@media (min-width: 960px){.VPHero[data-v-325add7b]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px}}.container[data-v-325add7b]{display:flex;flex-direction:column;margin:0 auto;max-width:1152px}@media (min-width: 960px){.container[data-v-325add7b]{flex-direction:row}}.main[data-v-325add7b]{position:relative;z-index:10;order:2;flex-grow:1;flex-shrink:0}.VPHero.has-image .container[data-v-325add7b]{text-align:center}@media (min-width: 960px){.VPHero.has-image .container[data-v-325add7b]{text-align:left}}@media (min-width: 960px){.main[data-v-325add7b]{order:1;width:calc((100% / 3) * 2)}.VPHero.has-image .main[data-v-325add7b]{max-width:592px}}.name[data-v-325add7b],.text[data-v-325add7b]{max-width:392px;letter-spacing:-.4px;line-height:40px;font-size:32px;font-weight:700;white-space:pre-wrap}.VPHero.has-image .name[data-v-325add7b],.VPHero.has-image .text[data-v-325add7b]{margin:0 auto}.name[data-v-325add7b]{color:var(--vp-home-hero-name-color)}.clip[data-v-325add7b]{background:var(--vp-home-hero-name-background);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--vp-home-hero-name-color)}@media (min-width: 640px){.name[data-v-325add7b],.text[data-v-325add7b]{max-width:576px;line-height:56px;font-size:48px}}@media (min-width: 960px){.name[data-v-325add7b],.text[data-v-325add7b]{line-height:64px;font-size:56px}.VPHero.has-image .name[data-v-325add7b],.VPHero.has-image .text[data-v-325add7b]{margin:0}}.tagline[data-v-325add7b]{padding-top:8px;max-width:392px;line-height:28px;font-size:18px;font-weight:500;white-space:pre-wrap;color:var(--vp-c-text-2)}.VPHero.has-image .tagline[data-v-325add7b]{margin:0 auto}@media (min-width: 640px){.tagline[data-v-325add7b]{padding-top:12px;max-width:576px;line-height:32px;font-size:20px}}@media (min-width: 960px){.tagline[data-v-325add7b]{line-height:36px;font-size:24px}.VPHero.has-image .tagline[data-v-325add7b]{margin:0}}.actions[data-v-325add7b]{display:flex;flex-wrap:wrap;margin:-6px;padding-top:24px}.VPHero.has-image .actions[data-v-325add7b]{justify-content:center}@media (min-width: 640px){.actions[data-v-325add7b]{padding-top:32px}}@media (min-width: 960px){.VPHero.has-image .actions[data-v-325add7b]{justify-content:flex-start}}.action[data-v-325add7b]{flex-shrink:0;padding:6px}.image[data-v-325add7b]{order:1;margin:-76px -24px -48px}@media (min-width: 640px){.image[data-v-325add7b]{margin:-108px -24px -48px}}@media (min-width: 960px){.image[data-v-325add7b]{flex-grow:1;order:2;margin:0;min-height:100%}}.image-container[data-v-325add7b]{position:relative;margin:0 auto;width:320px;height:320px}@media (min-width: 640px){.image-container[data-v-325add7b]{width:392px;height:392px}}@media (min-width: 960px){.image-container[data-v-325add7b]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;transform:translate(-32px,-32px)}}.image-bg[data-v-325add7b]{position:absolute;top:50%;left:50%;border-radius:50%;width:192px;height:192px;background-image:var(--vp-home-hero-image-background-image);filter:var(--vp-home-hero-image-filter);transform:translate(-50%,-50%)}@media (min-width: 640px){.image-bg[data-v-325add7b]{width:256px;height:256px}}@media (min-width: 960px){.image-bg[data-v-325add7b]{width:320px;height:320px}}[data-v-325add7b] .image-src{position:absolute;top:50%;left:50%;max-width:192px;max-height:192px;transform:translate(-50%,-50%)}@media (min-width: 640px){[data-v-325add7b] .image-src{max-width:256px;max-height:256px}}@media (min-width: 960px){[data-v-325add7b] .image-src{max-width:320px;max-height:320px}}.VPFeature[data-v-248ed6b6]{display:block;border:1px solid var(--vp-c-bg-soft);border-radius:12px;height:100%;background-color:var(--vp-c-bg-soft);transition:border-color .25s,background-color .25s}.VPFeature.link[data-v-248ed6b6]:hover{border-color:var(--vp-c-brand-1)}.box[data-v-248ed6b6]{display:flex;flex-direction:column;padding:24px;height:100%}.box[data-v-248ed6b6]>.VPImage{margin-bottom:20px}.icon[data-v-248ed6b6]{display:flex;justify-content:center;align-items:center;margin-bottom:20px;border-radius:6px;background-color:var(--vp-c-default-soft);width:48px;height:48px;font-size:24px;transition:background-color .25s}.title[data-v-248ed6b6]{line-height:24px;font-size:16px;font-weight:600}.details[data-v-248ed6b6]{flex-grow:1;padding-top:8px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.link-text[data-v-248ed6b6]{padding-top:8px}.link-text-value[data-v-248ed6b6]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.link-text-icon[data-v-248ed6b6]{margin-left:6px}.VPFeatures[data-v-dbb08ed4]{position:relative;padding:0 24px}@media (min-width: 640px){.VPFeatures[data-v-dbb08ed4]{padding:0 48px}}@media (min-width: 960px){.VPFeatures[data-v-dbb08ed4]{padding:0 64px}}.container[data-v-dbb08ed4]{margin:0 auto;max-width:1152px}.items[data-v-dbb08ed4]{display:flex;flex-wrap:wrap;margin:-8px}.item[data-v-dbb08ed4]{padding:8px;width:100%}@media (min-width: 640px){.item.grid-2[data-v-dbb08ed4],.item.grid-4[data-v-dbb08ed4],.item.grid-6[data-v-dbb08ed4]{width:50%}}@media (min-width: 768px){.item.grid-2[data-v-dbb08ed4],.item.grid-4[data-v-dbb08ed4]{width:50%}.item.grid-3[data-v-dbb08ed4],.item.grid-6[data-v-dbb08ed4]{width:calc(100% / 3)}}@media (min-width: 960px){.item.grid-4[data-v-dbb08ed4]{width:25%}}.container[data-v-bb690f02]{margin:auto;width:100%;max-width:1280px;padding:0 24px}@media (min-width: 640px){.container[data-v-bb690f02]{padding:0 48px}}@media (min-width: 960px){.container[data-v-bb690f02]{width:100%;padding:0 64px}}.vp-doc[data-v-bb690f02] .VPHomeSponsors,.vp-doc[data-v-bb690f02] .VPTeamPage{margin-left:var(--vp-offset, calc(50% - 50vw) );margin-right:var(--vp-offset, calc(50% - 50vw) )}.vp-doc[data-v-bb690f02] .VPHomeSponsors h2{border-top:none;letter-spacing:normal}.vp-doc[data-v-bb690f02] .VPHomeSponsors a,.vp-doc[data-v-bb690f02] .VPTeamPage a{text-decoration:none}.VPHome[data-v-972a96f9]{margin-bottom:96px}@media (min-width: 768px){.VPHome[data-v-972a96f9]{margin-bottom:128px}}.VPContent[data-v-ec7dbf3e]{flex-grow:1;flex-shrink:0;margin:var(--vp-layout-top-height, 0px) auto 0;width:100%}.VPContent.is-home[data-v-ec7dbf3e]{width:100%;max-width:100%}.VPContent.has-sidebar[data-v-ec7dbf3e]{margin:0}@media (min-width: 960px){.VPContent[data-v-ec7dbf3e]{padding-top:var(--vp-nav-height)}.VPContent.has-sidebar[data-v-ec7dbf3e]{margin:var(--vp-layout-top-height, 0px) 0 0;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPContent.has-sidebar[data-v-ec7dbf3e]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.VPFooter[data-v-e3ca6860]{position:relative;z-index:var(--vp-z-index-footer);border-top:1px solid var(--vp-c-gutter);padding:32px 24px;background-color:var(--vp-c-bg)}.VPFooter.has-sidebar[data-v-e3ca6860]{display:none}.VPFooter[data-v-e3ca6860] a{text-decoration-line:underline;text-underline-offset:2px;transition:color .25s}.VPFooter[data-v-e3ca6860] a:hover{color:var(--vp-c-text-1)}@media (min-width: 768px){.VPFooter[data-v-e3ca6860]{padding:32px}}.container[data-v-e3ca6860]{margin:0 auto;max-width:var(--vp-layout-max-width);text-align:center}.message[data-v-e3ca6860],.copyright[data-v-e3ca6860]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.VPLocalNavOutlineDropdown[data-v-b418bf42]{padding:12px 20px 11px}@media (min-width: 960px){.VPLocalNavOutlineDropdown[data-v-b418bf42]{padding:12px 36px 11px}}.VPLocalNavOutlineDropdown button[data-v-b418bf42]{display:block;font-size:12px;font-weight:500;line-height:24px;color:var(--vp-c-text-2);transition:color .5s;position:relative}.VPLocalNavOutlineDropdown button[data-v-b418bf42]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPLocalNavOutlineDropdown button.open[data-v-b418bf42]{color:var(--vp-c-text-1)}.icon[data-v-b418bf42]{display:inline-block;vertical-align:middle;margin-left:2px;font-size:14px;transform:rotate(0);transition:transform .25s}@media (min-width: 960px){.VPLocalNavOutlineDropdown button[data-v-b418bf42]{font-size:14px}.icon[data-v-b418bf42]{font-size:16px}}.open>.icon[data-v-b418bf42]{transform:rotate(90deg)}.items[data-v-b418bf42]{position:absolute;top:40px;right:16px;left:16px;display:grid;gap:1px;border:1px solid var(--vp-c-border);border-radius:8px;background-color:var(--vp-c-gutter);max-height:calc(var(--vp-vh, 100vh) - 86px);overflow:hidden auto;box-shadow:var(--vp-shadow-3)}@media (min-width: 960px){.items[data-v-b418bf42]{right:auto;left:calc(var(--vp-sidebar-width) + 32px);width:320px}}.header[data-v-b418bf42]{background-color:var(--vp-c-bg-soft)}.top-link[data-v-b418bf42]{display:block;padding:0 16px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.outline[data-v-b418bf42]{padding:8px 0;background-color:var(--vp-c-bg-soft)}.flyout-enter-active[data-v-b418bf42]{transition:all .2s ease-out}.flyout-leave-active[data-v-b418bf42]{transition:all .15s ease-in}.flyout-enter-from[data-v-b418bf42],.flyout-leave-to[data-v-b418bf42]{opacity:0;transform:translateY(-16px)}.VPLocalNav[data-v-8af612ea]{position:sticky;top:0;left:0;z-index:var(--vp-z-index-local-nav);border-bottom:1px solid var(--vp-c-gutter);padding-top:var(--vp-layout-top-height, 0px);width:100%;background-color:var(--vp-local-nav-bg-color)}.VPLocalNav.fixed[data-v-8af612ea]{position:fixed}@media (min-width: 960px){.VPLocalNav[data-v-8af612ea]{top:var(--vp-nav-height)}.VPLocalNav.has-sidebar[data-v-8af612ea]{padding-left:var(--vp-sidebar-width)}.VPLocalNav.empty[data-v-8af612ea]{display:none}}@media (min-width: 1280px){.VPLocalNav[data-v-8af612ea]{display:none}}@media (min-width: 1440px){.VPLocalNav.has-sidebar[data-v-8af612ea]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.container[data-v-8af612ea]{display:flex;justify-content:space-between;align-items:center}.menu[data-v-8af612ea]{display:flex;align-items:center;padding:12px 24px 11px;line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.menu[data-v-8af612ea]:hover{color:var(--vp-c-text-1);transition:color .25s}@media (min-width: 768px){.menu[data-v-8af612ea]{padding:0 32px}}@media (min-width: 960px){.menu[data-v-8af612ea]{display:none}}.menu-icon[data-v-8af612ea]{margin-right:8px;font-size:14px}.VPOutlineDropdown[data-v-8af612ea]{padding:12px 24px 11px}@media (min-width: 768px){.VPOutlineDropdown[data-v-8af612ea]{padding:12px 32px 11px}}.VPSwitch[data-v-d82e607b]{position:relative;border-radius:11px;display:block;width:40px;height:22px;flex-shrink:0;border:1px solid var(--vp-input-border-color);background-color:var(--vp-input-switch-bg-color);transition:border-color .25s!important}.VPSwitch[data-v-d82e607b]:hover{border-color:var(--vp-c-brand-1)}.check[data-v-d82e607b]{position:absolute;top:1px;left:1px;width:18px;height:18px;border-radius:50%;background-color:var(--vp-c-neutral-inverse);box-shadow:var(--vp-shadow-1);transition:transform .25s!important}.icon[data-v-d82e607b]{position:relative;display:block;width:18px;height:18px;border-radius:50%;overflow:hidden}.icon[data-v-d82e607b] [class^=vpi-]{position:absolute;top:3px;left:3px;width:12px;height:12px;color:var(--vp-c-text-2)}.dark .icon[data-v-d82e607b] [class^=vpi-]{color:var(--vp-c-text-1);transition:opacity .25s!important}.sun[data-v-3a50aa5c]{opacity:1}.moon[data-v-3a50aa5c],.dark .sun[data-v-3a50aa5c]{opacity:0}.dark .moon[data-v-3a50aa5c]{opacity:1}.dark .VPSwitchAppearance[data-v-3a50aa5c] .check{transform:translate(18px)}.VPNavBarAppearance[data-v-2a6692f8]{display:none}@media (min-width: 1280px){.VPNavBarAppearance[data-v-2a6692f8]{display:flex;align-items:center}}.VPMenuGroup+.VPMenuLink[data-v-79776a7a]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.link[data-v-79776a7a]{display:block;border-radius:6px;padding:0 12px;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);white-space:nowrap;transition:background-color .25s,color .25s}.link[data-v-79776a7a]:hover{color:var(--vp-c-brand-1);background-color:var(--vp-c-default-soft)}.link.active[data-v-79776a7a]{color:var(--vp-c-brand-1)}.VPMenuGroup[data-v-fbf15ead]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.VPMenuGroup[data-v-fbf15ead]:first-child{margin-top:0;border-top:0;padding-top:0}.VPMenuGroup+.VPMenuGroup[data-v-fbf15ead]{margin-top:12px;border-top:1px solid var(--vp-c-divider)}.title[data-v-fbf15ead]{padding:0 12px;line-height:32px;font-size:14px;font-weight:600;color:var(--vp-c-text-2);white-space:nowrap;transition:color .25s}.VPMenu[data-v-9990563e]{border-radius:12px;padding:12px;min-width:128px;border:1px solid var(--vp-c-divider);background-color:var(--vp-c-bg-elv);box-shadow:var(--vp-shadow-3);transition:background-color .5s;max-height:calc(100vh - var(--vp-nav-height));overflow-y:auto}.VPMenu[data-v-9990563e] .group{margin:0 -12px;padding:0 12px 12px}.VPMenu[data-v-9990563e] .group+.group{border-top:1px solid var(--vp-c-divider);padding:11px 12px 12px}.VPMenu[data-v-9990563e] .group:last-child{padding-bottom:0}.VPMenu[data-v-9990563e] .group+.item{border-top:1px solid var(--vp-c-divider);padding:11px 16px 0}.VPMenu[data-v-9990563e] .item{padding:0 16px;white-space:nowrap}.VPMenu[data-v-9990563e] .label{flex-grow:1;line-height:28px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.VPMenu[data-v-9990563e] .action{padding-left:24px}.VPFlyout[data-v-ec8c49bc]{position:relative}.VPFlyout[data-v-ec8c49bc]:hover{color:var(--vp-c-brand-1);transition:color .25s}.VPFlyout:hover .text[data-v-ec8c49bc]{color:var(--vp-c-text-2)}.VPFlyout:hover .icon[data-v-ec8c49bc]{fill:var(--vp-c-text-2)}.VPFlyout.active .text[data-v-ec8c49bc]{color:var(--vp-c-brand-1)}.VPFlyout.active:hover .text[data-v-ec8c49bc]{color:var(--vp-c-brand-2)}.VPFlyout:hover .menu[data-v-ec8c49bc],.button[aria-expanded=true]+.menu[data-v-ec8c49bc]{opacity:1;visibility:visible;transform:translateY(0)}.button[aria-expanded=false]+.menu[data-v-ec8c49bc]{opacity:0;visibility:hidden;transform:translateY(0)}.button[data-v-ec8c49bc]{display:flex;align-items:center;padding:0 12px;height:var(--vp-nav-height);color:var(--vp-c-text-1);transition:color .5s}.text[data-v-ec8c49bc]{display:flex;align-items:center;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.option-icon[data-v-ec8c49bc]{margin-right:0;font-size:16px}.text-icon[data-v-ec8c49bc]{margin-left:4px;font-size:14px}.icon[data-v-ec8c49bc]{font-size:20px;transition:fill .25s}.menu[data-v-ec8c49bc]{position:absolute;top:calc(var(--vp-nav-height) / 2 + 20px);right:0;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s,transform .25s}.VPSocialLink[data-v-b0526bd7]{display:flex;justify-content:center;align-items:center;width:36px;height:36px;color:var(--vp-c-text-2);transition:color .5s}.VPSocialLink[data-v-b0526bd7]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPSocialLink[data-v-b0526bd7]>svg,.VPSocialLink[data-v-b0526bd7]>[class^=vpi-social-]{width:20px;height:20px;fill:currentColor}.VPSocialLinks[data-v-fa18fe49]{display:flex;justify-content:center}.VPNavBarExtra[data-v-2fc967b6]{display:none;margin-right:-12px}@media (min-width: 768px){.VPNavBarExtra[data-v-2fc967b6]{display:block}}@media (min-width: 1280px){.VPNavBarExtra[data-v-2fc967b6]{display:none}}.trans-title[data-v-2fc967b6]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.item.appearance[data-v-2fc967b6],.item.social-links[data-v-2fc967b6]{display:flex;align-items:center;padding:0 12px}.item.appearance[data-v-2fc967b6]{min-width:176px}.appearance-action[data-v-2fc967b6]{margin-right:-2px}.social-links-list[data-v-2fc967b6]{margin:-4px -8px}.VPNavBarHamburger[data-v-be64de2d]{display:flex;justify-content:center;align-items:center;width:48px;height:var(--vp-nav-height)}@media (min-width: 768px){.VPNavBarHamburger[data-v-be64de2d]{display:none}}.container[data-v-be64de2d]{position:relative;width:16px;height:14px;overflow:hidden}.VPNavBarHamburger:hover .top[data-v-be64de2d]{top:0;left:0;transform:translate(4px)}.VPNavBarHamburger:hover .middle[data-v-be64de2d]{top:6px;left:0;transform:translate(0)}.VPNavBarHamburger:hover .bottom[data-v-be64de2d]{top:12px;left:0;transform:translate(8px)}.VPNavBarHamburger.active .top[data-v-be64de2d]{top:6px;transform:translate(0) rotate(225deg)}.VPNavBarHamburger.active .middle[data-v-be64de2d]{top:6px;transform:translate(16px)}.VPNavBarHamburger.active .bottom[data-v-be64de2d]{top:6px;transform:translate(0) rotate(135deg)}.VPNavBarHamburger.active:hover .top[data-v-be64de2d],.VPNavBarHamburger.active:hover .middle[data-v-be64de2d],.VPNavBarHamburger.active:hover .bottom[data-v-be64de2d]{background-color:var(--vp-c-text-2);transition:top .25s,background-color .25s,transform .25s}.top[data-v-be64de2d],.middle[data-v-be64de2d],.bottom[data-v-be64de2d]{position:absolute;width:16px;height:2px;background-color:var(--vp-c-text-1);transition:top .25s,background-color .5s,transform .25s}.top[data-v-be64de2d]{top:0;left:0;transform:translate(0)}.middle[data-v-be64de2d]{top:6px;left:0;transform:translate(8px)}.bottom[data-v-be64de2d]{top:12px;left:0;transform:translate(4px)}.VPNavBarMenuLink[data-v-ad4a8b64]{display:flex;align-items:center;padding:0 12px;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.VPNavBarMenuLink.active[data-v-ad4a8b64],.VPNavBarMenuLink[data-v-ad4a8b64]:hover{color:var(--vp-c-brand-1)}.VPNavBarMenu[data-v-0fb289c1]{display:none}@media (min-width: 768px){.VPNavBarMenu[data-v-0fb289c1]{display:flex}}/*! @docsearch/css 3.6.1 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 rgba(3,4,9,.30196078431372547);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;position:relative;padding:0 0 2px;border:0;top:-1px;width:20px}.DocSearch-Button-Key--pressed{transform:translate3d(0,1px,0);box-shadow:var(--docsearch-key-pressed-shadow)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;color:var(--docsearch-muted-color);border:0;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[class*=DocSearch]{--docsearch-primary-color: var(--vp-c-brand-1);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-text-color: var(--vp-c-text-1);--docsearch-muted-color: var(--vp-c-text-2);--docsearch-searchbox-shadow: none;--docsearch-searchbox-background: transparent;--docsearch-searchbox-focus-background: transparent;--docsearch-key-gradient: transparent;--docsearch-key-shadow: none;--docsearch-modal-background: var(--vp-c-bg-soft);--docsearch-footer-background: var(--vp-c-bg)}.dark [class*=DocSearch]{--docsearch-modal-shadow: none;--docsearch-footer-shadow: none;--docsearch-logo-color: var(--vp-c-text-2);--docsearch-hit-background: var(--vp-c-default-soft);--docsearch-hit-color: var(--vp-c-text-2);--docsearch-hit-shadow: none}.DocSearch-Button{display:flex;justify-content:center;align-items:center;margin:0;padding:0;width:48px;height:55px;background:transparent;transition:border-color .25s}.DocSearch-Button:hover{background:transparent}.DocSearch-Button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.DocSearch-Button-Key--pressed{transform:none;box-shadow:none}.DocSearch-Button:focus:not(:focus-visible){outline:none!important}@media (min-width: 768px){.DocSearch-Button{justify-content:flex-start;border:1px solid transparent;border-radius:8px;padding:0 10px 0 12px;width:100%;height:40px;background-color:var(--vp-c-bg-alt)}.DocSearch-Button:hover{border-color:var(--vp-c-brand-1);background:var(--vp-c-bg-alt)}}.DocSearch-Button .DocSearch-Button-Container{display:flex;align-items:center}.DocSearch-Button .DocSearch-Search-Icon{position:relative;width:16px;height:16px;color:var(--vp-c-text-1);fill:currentColor;transition:color .5s}.DocSearch-Button:hover .DocSearch-Search-Icon{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Search-Icon{top:1px;margin-right:8px;width:14px;height:14px;color:var(--vp-c-text-2)}}.DocSearch-Button .DocSearch-Button-Placeholder{display:none;margin-top:2px;padding:0 16px 0 0;font-size:13px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.DocSearch-Button:hover .DocSearch-Button-Placeholder{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Placeholder{display:inline-block}}.DocSearch-Button .DocSearch-Button-Keys{direction:ltr;display:none;min-width:auto}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Keys{display:flex;align-items:center}}.DocSearch-Button .DocSearch-Button-Key{display:block;margin:2px 0 0;border:1px solid var(--vp-c-divider);border-right:none;border-radius:4px 0 0 4px;padding-left:6px;min-width:0;width:auto;height:22px;line-height:22px;font-family:var(--vp-font-family-base);font-size:12px;font-weight:500;transition:color .5s,border-color .5s}.DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key{border-right:1px solid var(--vp-c-divider);border-left:none;border-radius:0 4px 4px 0;padding-left:2px;padding-right:6px}.DocSearch-Button .DocSearch-Button-Key:first-child{font-size:0!important}.DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"Ctrl";font-size:12px;letter-spacing:normal;color:var(--docsearch-muted-color)}.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"⌘"}.DocSearch-Button .DocSearch-Button-Key:first-child>*{display:none}.DocSearch-Search-Icon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E")}.VPNavBarSearch{display:flex;align-items:center}@media (min-width: 768px){.VPNavBarSearch{flex-grow:1;padding-left:24px}}@media (min-width: 960px){.VPNavBarSearch{padding-left:32px}}.dark .DocSearch-Footer{border-top:1px solid var(--vp-c-divider)}.DocSearch-Form{border:1px solid var(--vp-c-brand-1);background-color:var(--vp-c-white)}.dark .DocSearch-Form{background-color:var(--vp-c-default-soft)}.DocSearch-Screen-Icon>svg{margin:auto}.VPNavBarSocialLinks[data-v-f3b91b3a]{display:none}@media (min-width: 1280px){.VPNavBarSocialLinks[data-v-f3b91b3a]{display:flex;align-items:center}}.title[data-v-10b95b50]{display:flex;align-items:center;border-bottom:1px solid transparent;width:100%;height:var(--vp-nav-height);font-size:16px;font-weight:600;color:var(--vp-c-text-1);transition:opacity .25s}@media (min-width: 960px){.title[data-v-10b95b50]{flex-shrink:0}.VPNavBarTitle.has-sidebar .title[data-v-10b95b50]{border-bottom-color:var(--vp-c-divider)}}[data-v-10b95b50] .logo{margin-right:8px;height:var(--vp-nav-logo-height)}.VPNavBarTranslations[data-v-cd7b67e8]{display:none}@media (min-width: 1280px){.VPNavBarTranslations[data-v-cd7b67e8]{display:flex;align-items:center}}.title[data-v-cd7b67e8]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.VPNavBar[data-v-1303e283]{position:relative;height:var(--vp-nav-height);pointer-events:none;white-space:nowrap;transition:background-color .25s}.VPNavBar.screen-open[data-v-1303e283]{transition:none;background-color:var(--vp-nav-bg-color);border-bottom:1px solid var(--vp-c-divider)}.VPNavBar[data-v-1303e283]:not(.home){background-color:var(--vp-nav-bg-color)}@media (min-width: 960px){.VPNavBar[data-v-1303e283]:not(.home){background-color:transparent}.VPNavBar[data-v-1303e283]:not(.has-sidebar):not(.home.top){background-color:var(--vp-nav-bg-color)}}.wrapper[data-v-1303e283]{padding:0 8px 0 24px}@media (min-width: 768px){.wrapper[data-v-1303e283]{padding:0 32px}}@media (min-width: 960px){.VPNavBar.has-sidebar .wrapper[data-v-1303e283]{padding:0}}.container[data-v-1303e283]{display:flex;justify-content:space-between;margin:0 auto;max-width:calc(var(--vp-layout-max-width) - 64px);height:var(--vp-nav-height);pointer-events:none}.container>.title[data-v-1303e283],.container>.content[data-v-1303e283]{pointer-events:none}.container[data-v-1303e283] *{pointer-events:auto}@media (min-width: 960px){.VPNavBar.has-sidebar .container[data-v-1303e283]{max-width:100%}}.title[data-v-1303e283]{flex-shrink:0;height:calc(var(--vp-nav-height) - 1px);transition:background-color .5s}@media (min-width: 960px){.VPNavBar.has-sidebar .title[data-v-1303e283]{position:absolute;top:0;left:0;z-index:2;padding:0 32px;width:var(--vp-sidebar-width);height:var(--vp-nav-height);background-color:transparent}}@media (min-width: 1440px){.VPNavBar.has-sidebar .title[data-v-1303e283]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}.content[data-v-1303e283]{flex-grow:1}@media (min-width: 960px){.VPNavBar.has-sidebar .content[data-v-1303e283]{position:relative;z-index:1;padding-right:32px;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .content[data-v-1303e283]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2 + 32px);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.content-body[data-v-1303e283]{display:flex;justify-content:flex-end;align-items:center;height:var(--vp-nav-height);transition:background-color .5s}@media (min-width: 960px){.VPNavBar:not(.home.top) .content-body[data-v-1303e283]{position:relative;background-color:var(--vp-nav-bg-color)}.VPNavBar:not(.has-sidebar):not(.home.top) .content-body[data-v-1303e283]{background-color:transparent}}@media (max-width: 767px){.content-body[data-v-1303e283]{column-gap:.5rem}}.menu+.translations[data-v-1303e283]:before,.menu+.appearance[data-v-1303e283]:before,.menu+.social-links[data-v-1303e283]:before,.translations+.appearance[data-v-1303e283]:before,.appearance+.social-links[data-v-1303e283]:before{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--vp-c-divider);content:""}.menu+.appearance[data-v-1303e283]:before,.translations+.appearance[data-v-1303e283]:before{margin-right:16px}.appearance+.social-links[data-v-1303e283]:before{margin-left:16px}.social-links[data-v-1303e283]{margin-right:-8px}.divider[data-v-1303e283]{width:100%;height:1px}@media (min-width: 960px){.VPNavBar.has-sidebar .divider[data-v-1303e283]{padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .divider[data-v-1303e283]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.divider-line[data-v-1303e283]{width:100%;height:1px;transition:background-color .5s}.VPNavBar:not(.home) .divider-line[data-v-1303e283]{background-color:var(--vp-c-gutter)}@media (min-width: 960px){.VPNavBar:not(.home.top) .divider-line[data-v-1303e283]{background-color:var(--vp-c-gutter)}.VPNavBar:not(.has-sidebar):not(.home.top) .divider[data-v-1303e283]{background-color:var(--vp-c-gutter)}}.VPNavScreenAppearance[data-v-79da70de]{display:flex;justify-content:space-between;align-items:center;border-radius:8px;padding:12px 14px 12px 16px;background-color:var(--vp-c-bg-soft)}.text[data-v-79da70de]{line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.VPNavScreenMenuLink[data-v-9a3ef902]{display:block;border-bottom:1px solid var(--vp-c-divider);padding:12px 0 11px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:border-color .25s,color .25s}.VPNavScreenMenuLink[data-v-9a3ef902]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupLink[data-v-03f7344f]{display:block;margin-left:12px;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-1);transition:color .25s}.VPNavScreenMenuGroupLink[data-v-03f7344f]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupSection[data-v-3b79ab2a]{display:block}.title[data-v-3b79ab2a]{line-height:32px;font-size:13px;font-weight:700;color:var(--vp-c-text-2);transition:color .25s}.VPNavScreenMenuGroup[data-v-496537ac]{border-bottom:1px solid var(--vp-c-divider);height:48px;overflow:hidden;transition:border-color .5s}.VPNavScreenMenuGroup .items[data-v-496537ac]{visibility:hidden}.VPNavScreenMenuGroup.open .items[data-v-496537ac]{visibility:visible}.VPNavScreenMenuGroup.open[data-v-496537ac]{padding-bottom:10px;height:auto}.VPNavScreenMenuGroup.open .button[data-v-496537ac]{padding-bottom:6px;color:var(--vp-c-brand-1)}.VPNavScreenMenuGroup.open .button-icon[data-v-496537ac]{transform:rotate(45deg)}.button[data-v-496537ac]{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 11px 0;width:100%;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.button[data-v-496537ac]:hover{color:var(--vp-c-brand-1)}.button-icon[data-v-496537ac]{transition:transform .25s}.group[data-v-496537ac]:first-child{padding-top:0}.group+.group[data-v-496537ac],.group+.item[data-v-496537ac]{padding-top:4px}.VPNavScreenTranslations[data-v-c618ff37]{height:24px;overflow:hidden}.VPNavScreenTranslations.open[data-v-c618ff37]{height:auto}.title[data-v-c618ff37]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-text-1)}.icon[data-v-c618ff37]{font-size:16px}.icon.lang[data-v-c618ff37]{margin-right:8px}.icon.chevron[data-v-c618ff37]{margin-left:4px}.list[data-v-c618ff37]{padding:4px 0 0 24px}.link[data-v-c618ff37]{line-height:32px;font-size:13px;color:var(--vp-c-text-1)}.VPNavScreen[data-v-c3a48aed]{position:fixed;top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px));right:0;bottom:0;left:0;padding:0 32px;width:100%;background-color:var(--vp-nav-screen-bg-color);overflow-y:auto;transition:background-color .25s;pointer-events:auto}.VPNavScreen.fade-enter-active[data-v-c3a48aed],.VPNavScreen.fade-leave-active[data-v-c3a48aed]{transition:opacity .25s}.VPNavScreen.fade-enter-active .container[data-v-c3a48aed],.VPNavScreen.fade-leave-active .container[data-v-c3a48aed]{transition:transform .25s ease}.VPNavScreen.fade-enter-from[data-v-c3a48aed],.VPNavScreen.fade-leave-to[data-v-c3a48aed]{opacity:0}.VPNavScreen.fade-enter-from .container[data-v-c3a48aed],.VPNavScreen.fade-leave-to .container[data-v-c3a48aed]{transform:translateY(-8px)}@media (min-width: 768px){.VPNavScreen[data-v-c3a48aed]{display:none}}.container[data-v-c3a48aed]{margin:0 auto;padding:24px 0 96px;max-width:288px}.menu+.translations[data-v-c3a48aed],.menu+.appearance[data-v-c3a48aed],.translations+.appearance[data-v-c3a48aed]{margin-top:24px}.menu+.social-links[data-v-c3a48aed]{margin-top:16px}.appearance+.social-links[data-v-c3a48aed]{margin-top:16px}.VPNav[data-v-2a4e514e]{position:relative;top:var(--vp-layout-top-height, 0px);left:0;z-index:var(--vp-z-index-nav);width:100%;pointer-events:none;transition:background-color .5s}@media (min-width: 960px){.VPNav[data-v-2a4e514e]{position:fixed}}.VPSidebarItem.level-0[data-v-9035698b]{padding-bottom:24px}.VPSidebarItem.collapsed.level-0[data-v-9035698b]{padding-bottom:10px}.item[data-v-9035698b]{position:relative;display:flex;width:100%}.VPSidebarItem.collapsible>.item[data-v-9035698b]{cursor:pointer}.indicator[data-v-9035698b]{position:absolute;top:6px;bottom:6px;left:-17px;width:2px;border-radius:2px;transition:background-color .25s}.VPSidebarItem.level-2.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-3.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-4.is-active>.item>.indicator[data-v-9035698b],.VPSidebarItem.level-5.is-active>.item>.indicator[data-v-9035698b]{background-color:var(--vp-c-brand-1)}.link[data-v-9035698b]{display:flex;align-items:center;flex-grow:1}.text[data-v-9035698b]{flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;transition:color .25s}.VPSidebarItem.level-0 .text[data-v-9035698b]{font-weight:700;color:var(--vp-c-text-1)}.VPSidebarItem.level-1 .text[data-v-9035698b],.VPSidebarItem.level-2 .text[data-v-9035698b],.VPSidebarItem.level-3 .text[data-v-9035698b],.VPSidebarItem.level-4 .text[data-v-9035698b],.VPSidebarItem.level-5 .text[data-v-9035698b]{font-weight:500;color:var(--vp-c-text-2)}.VPSidebarItem.level-0.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-1.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-2.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-3.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-4.is-link>.item>.link:hover .text[data-v-9035698b],.VPSidebarItem.level-5.is-link>.item>.link:hover .text[data-v-9035698b]{color:var(--vp-c-brand-1)}.VPSidebarItem.level-0.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-1.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-2.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-3.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-4.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-5.has-active>.item>.text[data-v-9035698b],.VPSidebarItem.level-0.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-1.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-2.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-3.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-4.has-active>.item>.link>.text[data-v-9035698b],.VPSidebarItem.level-5.has-active>.item>.link>.text[data-v-9035698b]{color:var(--vp-c-text-1)}.VPSidebarItem.level-0.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-1.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-2.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-3.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-4.is-active>.item .link>.text[data-v-9035698b],.VPSidebarItem.level-5.is-active>.item .link>.text[data-v-9035698b]{color:var(--vp-c-brand-1)}.caret[data-v-9035698b]{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--vp-c-text-3);cursor:pointer;transition:color .25s;flex-shrink:0}.item:hover .caret[data-v-9035698b]{color:var(--vp-c-text-2)}.item:hover .caret[data-v-9035698b]:hover{color:var(--vp-c-text-1)}.caret-icon[data-v-9035698b]{font-size:18px;transform:rotate(90deg);transition:transform .25s}.VPSidebarItem.collapsed .caret-icon[data-v-9035698b]{transform:rotate(0)}.VPSidebarItem.level-1 .items[data-v-9035698b],.VPSidebarItem.level-2 .items[data-v-9035698b],.VPSidebarItem.level-3 .items[data-v-9035698b],.VPSidebarItem.level-4 .items[data-v-9035698b],.VPSidebarItem.level-5 .items[data-v-9035698b]{border-left:1px solid var(--vp-c-divider);padding-left:16px}.VPSidebarItem.collapsed .items[data-v-9035698b]{display:none}.no-transition[data-v-c3eaeb1a] .caret-icon{transition:none}.group+.group[data-v-c3eaeb1a]{border-top:1px solid var(--vp-c-divider);padding-top:10px}@media (min-width: 960px){.group[data-v-c3eaeb1a]{padding-top:10px;width:calc(var(--vp-sidebar-width) - 64px)}}.VPSidebar[data-v-edd7de80]{position:fixed;top:var(--vp-layout-top-height, 0px);bottom:0;left:0;z-index:var(--vp-z-index-sidebar);padding:32px 32px 96px;width:calc(100vw - 64px);max-width:320px;background-color:var(--vp-sidebar-bg-color);opacity:0;box-shadow:var(--vp-c-shadow-3);overflow-x:hidden;overflow-y:auto;transform:translate(-100%);transition:opacity .5s,transform .25s ease;overscroll-behavior:contain}.VPSidebar.open[data-v-edd7de80]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .25s,transform .5s cubic-bezier(.19,1,.22,1)}.dark .VPSidebar[data-v-edd7de80]{box-shadow:var(--vp-shadow-1)}@media (min-width: 960px){.VPSidebar[data-v-edd7de80]{padding-top:var(--vp-nav-height);width:var(--vp-sidebar-width);max-width:100%;background-color:var(--vp-sidebar-bg-color);opacity:1;visibility:visible;box-shadow:none;transform:translate(0)}}@media (min-width: 1440px){.VPSidebar[data-v-edd7de80]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}@media (min-width: 960px){.curtain[data-v-edd7de80]{position:sticky;top:-64px;left:0;z-index:1;margin-top:calc(var(--vp-nav-height) * -1);margin-right:-32px;margin-left:-32px;height:var(--vp-nav-height);background-color:var(--vp-sidebar-bg-color)}}.nav[data-v-edd7de80]{outline:0}.VPSkipLink[data-v-3e86afbf]{top:8px;left:8px;padding:8px 16px;z-index:999;border-radius:8px;font-size:12px;font-weight:700;text-decoration:none;color:var(--vp-c-brand-1);box-shadow:var(--vp-shadow-3);background-color:var(--vp-c-bg)}.VPSkipLink[data-v-3e86afbf]:focus{height:auto;width:auto;clip:auto;clip-path:none}@media (min-width: 1280px){.VPSkipLink[data-v-3e86afbf]{top:14px;left:16px}}.Layout[data-v-22f859ac]{display:flex;flex-direction:column;min-height:100vh}.VPHomeSponsors[data-v-65f3b3fb]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPHomeSponsors[data-v-65f3b3fb]{margin:96px 0}@media (min-width: 768px){.VPHomeSponsors[data-v-65f3b3fb]{margin:128px 0}}.VPHomeSponsors[data-v-65f3b3fb]{padding:0 24px}@media (min-width: 768px){.VPHomeSponsors[data-v-65f3b3fb]{padding:0 48px}}@media (min-width: 960px){.VPHomeSponsors[data-v-65f3b3fb]{padding:0 64px}}.container[data-v-65f3b3fb]{margin:0 auto;max-width:1152px}.love[data-v-65f3b3fb]{margin:0 auto;width:fit-content;font-size:28px;color:var(--vp-c-text-3)}.icon[data-v-65f3b3fb]{display:inline-block}.message[data-v-65f3b3fb]{margin:0 auto;padding-top:10px;max-width:320px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.sponsors[data-v-65f3b3fb]{padding-top:32px}.action[data-v-65f3b3fb]{padding-top:40px;text-align:center}.VPTeamPage[data-v-7ee49781]{margin:96px 0}@media (min-width: 768px){.VPTeamPage[data-v-7ee49781]{margin:128px 0}}.VPHome .VPTeamPageTitle[data-v-7ee49781-s]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPTeamPageSection+.VPTeamPageSection[data-v-7ee49781-s],.VPTeamMembers+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:64px}.VPTeamMembers+.VPTeamMembers[data-v-7ee49781-s]{margin-top:24px}@media (min-width: 768px){.VPTeamPageTitle+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:16px}.VPTeamPageSection+.VPTeamPageSection[data-v-7ee49781-s],.VPTeamMembers+.VPTeamPageSection[data-v-7ee49781-s]{margin-top:96px}}.VPTeamMembers[data-v-7ee49781-s]{padding:0 24px}@media (min-width: 768px){.VPTeamMembers[data-v-7ee49781-s]{padding:0 48px}}@media (min-width: 960px){.VPTeamMembers[data-v-7ee49781-s]{padding:0 64px}}.VPTeamPageTitle[data-v-7199c4a1]{padding:48px 32px;text-align:center}@media (min-width: 768px){.VPTeamPageTitle[data-v-7199c4a1]{padding:64px 48px 48px}}@media (min-width: 960px){.VPTeamPageTitle[data-v-7199c4a1]{padding:80px 64px 48px}}.title[data-v-7199c4a1]{letter-spacing:0;line-height:44px;font-size:36px;font-weight:500}@media (min-width: 768px){.title[data-v-7199c4a1]{letter-spacing:-.5px;line-height:56px;font-size:48px}}.lead[data-v-7199c4a1]{margin:0 auto;max-width:512px;padding-top:12px;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 768px){.lead[data-v-7199c4a1]{max-width:592px;letter-spacing:.15px;line-height:28px;font-size:20px}}.VPTeamPageSection[data-v-e7d273f9]{padding:0 32px}@media (min-width: 768px){.VPTeamPageSection[data-v-e7d273f9]{padding:0 48px}}@media (min-width: 960px){.VPTeamPageSection[data-v-e7d273f9]{padding:0 64px}}.title[data-v-e7d273f9]{position:relative;margin:0 auto;max-width:1152px;text-align:center;color:var(--vp-c-text-2)}.title-line[data-v-e7d273f9]{position:absolute;top:16px;left:0;width:100%;height:1px;background-color:var(--vp-c-divider)}.title-text[data-v-e7d273f9]{position:relative;display:inline-block;padding:0 24px;letter-spacing:0;line-height:32px;font-size:20px;font-weight:500;background-color:var(--vp-c-bg)}.lead[data-v-e7d273f9]{margin:0 auto;max-width:480px;padding-top:12px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.members[data-v-e7d273f9]{padding-top:40px}.VPTeamMembersItem[data-v-37dee882]{display:flex;flex-direction:column;gap:2px;border-radius:12px;width:100%;height:100%;overflow:hidden}.VPTeamMembersItem.small .profile[data-v-37dee882]{padding:32px}.VPTeamMembersItem.small .data[data-v-37dee882]{padding-top:20px}.VPTeamMembersItem.small .avatar[data-v-37dee882]{width:64px;height:64px}.VPTeamMembersItem.small .name[data-v-37dee882]{line-height:24px;font-size:16px}.VPTeamMembersItem.small .affiliation[data-v-37dee882]{padding-top:4px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .desc[data-v-37dee882]{padding-top:12px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .links[data-v-37dee882]{margin:0 -16px -20px;padding:10px 0 0}.VPTeamMembersItem.medium .profile[data-v-37dee882]{padding:48px 32px}.VPTeamMembersItem.medium .data[data-v-37dee882]{padding-top:24px;text-align:center}.VPTeamMembersItem.medium .avatar[data-v-37dee882]{width:96px;height:96px}.VPTeamMembersItem.medium .name[data-v-37dee882]{letter-spacing:.15px;line-height:28px;font-size:20px}.VPTeamMembersItem.medium .affiliation[data-v-37dee882]{padding-top:4px;font-size:16px}.VPTeamMembersItem.medium .desc[data-v-37dee882]{padding-top:16px;max-width:288px;font-size:16px}.VPTeamMembersItem.medium .links[data-v-37dee882]{margin:0 -16px -12px;padding:16px 12px 0}.profile[data-v-37dee882]{flex-grow:1;background-color:var(--vp-c-bg-soft)}.data[data-v-37dee882]{text-align:center}.avatar[data-v-37dee882]{position:relative;flex-shrink:0;margin:0 auto;border-radius:50%;box-shadow:var(--vp-shadow-3)}.avatar-img[data-v-37dee882]{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;object-fit:cover}.name[data-v-37dee882]{margin:0;font-weight:600}.affiliation[data-v-37dee882]{margin:0;font-weight:500;color:var(--vp-c-text-2)}.org.link[data-v-37dee882]{color:var(--vp-c-text-2);transition:color .25s}.org.link[data-v-37dee882]:hover{color:var(--vp-c-brand-1)}.desc[data-v-37dee882]{margin:0 auto}.desc[data-v-37dee882] a{font-weight:500;color:var(--vp-c-brand-1);text-decoration-style:dotted;transition:color .25s}.links[data-v-37dee882]{display:flex;justify-content:center;height:56px}.sp-link[data-v-37dee882]{display:flex;justify-content:center;align-items:center;text-align:center;padding:16px;font-size:14px;font-weight:500;color:var(--vp-c-sponsor);background-color:var(--vp-c-bg-soft);transition:color .25s,background-color .25s}.sp .sp-link.link[data-v-37dee882]:hover,.sp .sp-link.link[data-v-37dee882]:focus{outline:none;color:var(--vp-c-white);background-color:var(--vp-c-sponsor)}.sp-icon[data-v-37dee882]{margin-right:8px;font-size:16px}.VPTeamMembers.small .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(224px,1fr))}.VPTeamMembers.small.count-1 .container[data-v-43ad829f]{max-width:276px}.VPTeamMembers.small.count-2 .container[data-v-43ad829f]{max-width:576px}.VPTeamMembers.small.count-3 .container[data-v-43ad829f]{max-width:876px}.VPTeamMembers.medium .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(256px,1fr))}@media (min-width: 375px){.VPTeamMembers.medium .container[data-v-43ad829f]{grid-template-columns:repeat(auto-fit,minmax(288px,1fr))}}.VPTeamMembers.medium.count-1 .container[data-v-43ad829f]{max-width:368px}.VPTeamMembers.medium.count-2 .container[data-v-43ad829f]{max-width:760px}.container[data-v-43ad829f]{display:grid;gap:24px;margin:0 auto;max-width:1152px} diff --git a/assets/zht_api_mp_math_angle.md.lzcXwnW6.js b/assets/zht_api_mp_math_angle.md.ByT5Hatc.js similarity index 74% rename from assets/zht_api_mp_math_angle.md.lzcXwnW6.js rename to assets/zht_api_mp_math_angle.md.ByT5Hatc.js index 9003c28..611c52d 100644 --- a/assets/zht_api_mp_math_angle.md.lzcXwnW6.js +++ b/assets/zht_api_mp_math_angle.md.ByT5Hatc.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/angle.md","filePath":"zht/api/mp_math/angle.md"}'),t={name:"zht/api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

變數説明:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源碼
python
def __init__(self, value: float, is_radian: bool=False):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/angle.md","filePath":"zht/api/mp_math/angle.md"}'),t={name:"zht/api/mp_math/angle.md"},e=n(`

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

變數説明:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源碼

在GitHub上查看

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -8,92 +8,92 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

返回: 余角

源碼
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

返回: 余角

源碼

在GitHub上查看

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

返回: 补角

源碼
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

返回: 补角

源碼

在GitHub上查看

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

返回: 弧度

源碼
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

返回: 弧度

源碼

在GitHub上查看

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

返回: 最小正角度

源碼
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

返回: 最小正角度

源碼

在GitHub上查看

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

返回: 最大负角度

源碼
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

返回: 最大负角度

源碼

在GitHub上查看

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

返回: 正弦值

源碼
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

返回: 正弦值

源碼

在GitHub上查看

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

返回: 余弦值

源碼
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

返回: 余弦值

源碼

在GitHub上查看

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

返回: 正切值

源碼
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

返回: 正切值

源碼

在GitHub上查看

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

返回: 余切值

源碼
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

返回: 余切值

源碼

在GitHub上查看

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

返回: 正割值

源碼
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

返回: 正割值

源碼

在GitHub上查看

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

返回: 余割值

源碼
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

返回: 余割值

源碼

在GitHub上查看

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源碼
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

源碼
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源碼
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源碼
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源碼

在GitHub上查看

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

源碼

在GitHub上查看

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

源碼

在GitHub上查看

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源碼

在GitHub上查看

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源碼

在GitHub上查看

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

源碼
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

源碼

在GitHub上查看

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

源碼
python
def __truediv__(self, other):
+    ...

def self / other

源碼

在GitHub上查看

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
-    return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; + return AnyAngle(self.radian / other, is_radian=True)
`,80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_angle.md.lzcXwnW6.lean.js b/assets/zht_api_mp_math_angle.md.ByT5Hatc.lean.js similarity index 68% rename from assets/zht_api_mp_math_angle.md.lzcXwnW6.lean.js rename to assets/zht_api_mp_math_angle.md.ByT5Hatc.lean.js index 07adbfd..5a1fde9 100644 --- a/assets/zht_api_mp_math_angle.md.lzcXwnW6.lean.js +++ b/assets/zht_api_mp_math_angle.md.ByT5Hatc.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/angle.md","filePath":"zht/api/mp_math/angle.md"}'),t={name:"zht/api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{F as __pageData,E as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/angle.md","filePath":"zht/api/mp_math/angle.md"}'),t={name:"zht/api/mp_math/angle.md"},e=n("",80),l=[e];function h(p,k,r,d,o,g){return a(),i("div",null,l)}const F=s(t,[["render",h]]);export{c as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_equation.md.BAr_ktNP.lean.js b/assets/zht_api_mp_math_equation.md.BAr_ktNP.lean.js deleted file mode 100644 index 91e9901..0000000 --- a/assets/zht_api_mp_math_equation.md.BAr_ktNP.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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("",23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; diff --git a/assets/zht_api_mp_math_equation.md.BAr_ktNP.js b/assets/zht_api_mp_math_equation.md.C9JJo8Tj.js similarity index 83% rename from assets/zht_api_mp_math_equation.md.BAr_ktNP.js rename to assets/zht_api_mp_math_equation.md.C9JJo8Tj.js index 4301dee..c26c18b 100644 --- a/assets/zht_api_mp_math_equation.md.BAr_ktNP.js +++ b/assets/zht_api_mp_math_equation.md.C9JJo8Tj.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"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(`

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),t={name:"zht/api/mp_math/equation.md"},l=n(`

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼

在GitHub上查看

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:

返回: 目标点

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

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

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:

返回: 目标点

源碼

在GitHub上查看

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

變數説明:

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

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

變數説明:

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

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼

在GitHub上查看

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return result_func(*args)
         return high_order_partial_derivative_func
     else:
-        raise ValueError('Invalid var type')
`,23),p=[t];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const u=s(l,[["render",h]]);export{F as __pageData,u as default}; + raise ValueError('Invalid var type')
`,23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_equation.md.C9JJo8Tj.lean.js b/assets/zht_api_mp_math_equation.md.C9JJo8Tj.lean.js new file mode 100644 index 0000000..9b4276c --- /dev/null +++ b/assets/zht_api_mp_math_equation.md.C9JJo8Tj.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/equation.md","filePath":"zht/api/mp_math/equation.md"}'),t={name:"zht/api/mp_math/equation.md"},l=n("",23),p=[l];function h(k,e,r,E,d,g){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{u as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_function.md.C2Gp7z0v.js b/assets/zht_api_mp_math_function.md.CUiziArf.js similarity index 96% rename from assets/zht_api_mp_math_function.md.C2Gp7z0v.js rename to assets/zht_api_mp_math_function.md.CUiziArf.js index 53b0939..320f0b5 100644 --- a/assets/zht_api_mp_math_function.md.C2Gp7z0v.js +++ b/assets/zht_api_mp_math_function.md.CUiziArf.js @@ -1,4 +1,4 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/function.md","filePath":"zht/api/mp_math/function.md"}'),e={name:"zht/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

變數説明:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源碼
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/function.md","filePath":"zht/api/mp_math/function.md"}'),e={name:"zht/api/mp_math/function.md"},Q=a('

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

',4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a('',1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a('',1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a('',1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a(`

變數説明:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源碼

在GitHub上查看

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -17,7 +17,7 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

變數説明:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

範例:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
源碼
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
源碼

在GitHub上查看

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -39,4 +39,4 @@ import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1
     def curried_func(*args2: Var) -> Var:
         """@litedoc-hide"""
         return func(*args, *args2)
-    return curried_func
`,13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; + return curried_func
`,13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/zht_api_mp_math_function.md.C2Gp7z0v.lean.js b/assets/zht_api_mp_math_function.md.CUiziArf.lean.js similarity index 98% rename from assets/zht_api_mp_math_function.md.C2Gp7z0v.lean.js rename to assets/zht_api_mp_math_function.md.CUiziArf.lean.js index 09e4ad5..2b344c5 100644 --- a/assets/zht_api_mp_math_function.md.C2Gp7z0v.lean.js +++ b/assets/zht_api_mp_math_function.md.CUiziArf.lean.js @@ -1 +1 @@ -import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/function.md","filePath":"zht/api/mp_math/function.md"}'),e={name:"zht/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(L,b,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; +import{_ as l,c as t,j as s,a as n,a2 as a,o as i}from"./chunks/framework.C94oF1kp.js";const Z=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/function.md","filePath":"zht/api/mp_math/function.md"}'),e={name:"zht/api/mp_math/function.md"},Q=a("",4),T={class:"tip custom-block github-alert"},h=s("p",{class:"custom-block-title"},"TIP",-1),p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},r={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.471ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3744.3 1000","aria-hidden":"true"},d=a("",1),k=[d],o=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("mi",null,"x"),s("mo",null,","),s("mi",null,"y"),s("mo",null,","),s("mi",null,"z"),s("mo",{stretchy:"false"},")")])],-1),m={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"10.19ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 4504 1000","aria-hidden":"true"},c=a("",1),y=[c],u=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")")])],-1),E={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},F={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-1.469ex"},xmlns:"http://www.w3.org/2000/svg",width:"29.427ex",height:"4.07ex",role:"img",focusable:"false",viewBox:"0 -1149.5 13006.8 1799","aria-hidden":"true"},f=a("",1),_=[f],C=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",{mathvariant:"normal"},"∇"),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"y"),s("mn",null,"0")]),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mn",null,"0")]),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mrow",{"data-mjx-texclass":"INNER"},[s("mo",{"data-mjx-texclass":"OPEN"},"("),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"x")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"y")])]),s("mo",null,","),s("mfrac",null,[s("mrow",null,[s("mi",null,"∂"),s("mi",null,"f")]),s("mrow",null,[s("mi",null,"∂"),s("mi",null,"z")])]),s("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),w=a("",13);function x(b,L,H,B,M,D){return i(),t("div",null,[Q,s("div",T,[h,s("p",null,[n("已知一个函数"),s("mjx-container",p,[(i(),t("svg",r,k)),o]),n(",则其在点"),s("mjx-container",m,[(i(),t("svg",g,y)),u]),n("处的梯度向量为: "),s("mjx-container",E,[(i(),t("svg",F,_)),C])])]),w])}const A=l(e,[["render",x]]);export{Z as __pageData,A as default}; diff --git a/assets/zht_api_mp_math_line.md.DX62bgjZ.js b/assets/zht_api_mp_math_line.md.TSJBrHTa.js similarity index 77% rename from assets/zht_api_mp_math_line.md.DX62bgjZ.js rename to assets/zht_api_mp_math_line.md.TSJBrHTa.js index 8038235..77a21ef 100644 --- a/assets/zht_api_mp_math_line.md.DX62bgjZ.js +++ b/assets/zht_api_mp_math_line.md.TSJBrHTa.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/line.md","filePath":"zht/api/mp_math/line.md"}'),l={name:"zht/api/mp_math/line.md"},t=n(`

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

變數説明:

  • point: 直线上的一点
  • direction: 直线的方向向量
源碼
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/line.md","filePath":"zht/api/mp_math/line.md"}'),t={name:"zht/api/mp_math/line.md"},l=n(`

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

變數説明:

  • point: 直线上的一点
  • direction: 直线的方向向量
源碼

在GitHub上查看

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -6,7 +6,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源碼
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

變數説明:

  • other: 另一条直线

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

變數説明:

  • other: 另一条直线

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -25,7 +25,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

變數説明:

  • other: 平行直线或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

變數説明:

  • other: 平行直线或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

變數説明:

  • other: 另一条直线

返回: 交点

抛出:

  • ValueError 直线平行
  • ValueError 直线不共面
源碼
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

變數説明:

  • other: 另一条直线

返回: 交点

抛出:

  • ValueError 直线平行
  • ValueError 直线不共面
源碼

在GitHub上查看

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

變數説明:

  • point: 指定点

返回: 垂线

源碼
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

變數説明:

  • point: 指定点

返回: 垂线

源碼

在GitHub上查看

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -71,7 +71,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

變數説明:

  • t: 参数t

返回: 点

源碼
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

變數説明:

  • t: 参数t

返回: 点

源碼

在GitHub上查看

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -79,13 +79,13 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源碼
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源碼

在GitHub上查看

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源碼
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源碼

在GitHub上查看

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -94,7 +94,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

變數説明:

  • other: 另一条直线

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

變數説明:

  • other: 另一条直线

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -102,7 +102,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

變數説明:

  • other: 另一条直线

返回: 是否共线

源碼
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

變數説明:

  • other: 另一条直线

返回: 是否共线

源碼

在GitHub上查看

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -110,7 +110,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

變數説明:

  • point: 点

返回: 是否在直线上

源碼
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

變數説明:

  • point: 点

返回: 是否在直线上

源碼

在GitHub上查看

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -118,7 +118,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

變數説明:

  • other: 另一条直线

返回: 是否共面

源碼
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

變數説明:

  • other: 另一条直线

返回: 是否共面

源碼

在GitHub上查看

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -127,7 +127,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源碼
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源碼

在GitHub上查看

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -140,7 +140,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

變數説明:

  • p1: 点1
  • p2: 点2

返回: 直线

源碼
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

變數説明:

  • p1: 点1
  • p2: 点2

返回: 直线

源碼

在GitHub上查看

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -151,7 +151,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

變數説明:

  • other: 另一条直线

返回: 交点

源碼
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

變數説明:

  • other: 另一条直线

返回: 交点

源碼

在GitHub上查看

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -164,7 +164,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

變數説明:

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

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

變數説明:

  • other:
源碼

在GitHub上查看

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -175,4 +175,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         Returns:
 
         """
-    return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; + return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)
`,107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/zht_api_mp_math_line.md.DX62bgjZ.lean.js b/assets/zht_api_mp_math_line.md.TSJBrHTa.lean.js similarity index 58% rename from assets/zht_api_mp_math_line.md.DX62bgjZ.lean.js rename to assets/zht_api_mp_math_line.md.TSJBrHTa.lean.js index 55a0c8a..65003d2 100644 --- a/assets/zht_api_mp_math_line.md.DX62bgjZ.lean.js +++ b/assets/zht_api_mp_math_line.md.TSJBrHTa.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/line.md","filePath":"zht/api/mp_math/line.md"}'),l={name:"zht/api/mp_math/line.md"},t=n("",107),p=[t];function e(h,k,r,o,d,g){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{E as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.line","description":"","frontmatter":{"title":"mbcp.mp_math.line","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/line.md","filePath":"zht/api/mp_math/line.md"}'),t={name:"zht/api/mp_math/line.md"},l=n("",107),e=[l];function p(h,k,r,o,d,g){return a(),i("div",null,e)}const y=s(t,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/zht_api_mp_math_plane.md.DJ_9NQFz.js b/assets/zht_api_mp_math_plane.md.CO3Dxqtg.js similarity index 83% rename from assets/zht_api_mp_math_plane.md.DJ_9NQFz.js rename to assets/zht_api_mp_math_plane.md.CO3Dxqtg.js index 9046d88..a4a7f1e 100644 --- a/assets/zht_api_mp_math_plane.md.DJ_9NQFz.js +++ b/assets/zht_api_mp_math_plane.md.CO3Dxqtg.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/plane.md","filePath":"zht/api/mp_math/plane.md"}'),l={name:"zht/api/mp_math/plane.md"},h=n(`

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

變數説明:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源碼
python
def __init__(self, a: float, b: float, c: float, d: float):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/plane.md","filePath":"zht/api/mp_math/plane.md"}'),l={name:"zht/api/mp_math/plane.md"},t=n(`

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

變數説明:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源碼

在GitHub上查看

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -10,7 +10,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

變數説明:

  • other: 另一个平面

返回: 是否近似相等

源碼
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

變數説明:

  • other: 另一个平面

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -28,7 +28,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

變數説明:

  • other: 另一个平面

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

變數説明:

  • other: 另一个平面

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -43,7 +43,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

變數説明:

  • other: 另一个平面或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

變數説明:

  • other: 另一个平面或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

變數説明:

  • other: 另一个平面

返回: 两平面的交线

源碼
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

變數説明:

  • other: 另一个平面

返回: 两平面的交线

源碼

在GitHub上查看

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -83,7 +83,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

變數説明:

  • other: 不与平面平行或在平面上的直线

返回: 交点

抛出:

  • ValueError 平面与直线平行或重合
源碼
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

變數説明:

  • other: 不与平面平行或在平面上的直线

返回: 交点

抛出:

  • ValueError 平面与直线平行或重合
源碼

在GitHub上查看

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -97,7 +97,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

變數説明:

  • point: 指定点

返回: 所求平面

源碼
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

變數説明:

  • point: 指定点

返回: 所求平面

源碼

在GitHub上查看

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -105,7 +105,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

變數説明:

  • other: 另一个平面

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

變數説明:

  • other: 另一个平面

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -113,14 +113,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

返回: 法向量

源碼
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

返回: 法向量

源碼

在GitHub上查看

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

變數説明:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源碼
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

變數説明:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -132,7 +132,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

變數説明:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源碼
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

變數説明:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

變數説明:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源碼
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

變數説明:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -160,7 +160,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

變數説明:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源碼
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

變數説明:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -170,11 +170,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源碼
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源碼

在GitHub上查看

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源碼
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源碼

在GitHub上查看

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

變數説明:

  • other:

返回: 不平行平面的交线,平面平行返回None

源碼
python
def __and__(self, other):
+    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

變數説明:

  • other:

返回: 不平行平面的交线,平面平行返回None

源碼

在GitHub上查看

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -191,6 +191,6 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

源碼
python
def __rand__(self, other: 'Line3') -> 'Point3':
-    return self.cal_intersection_point3(other)
`,105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; + raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

源碼

在GitHub上查看

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

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

源碼

在GitHub上查看

python
def __rand__(self, other: 'Line3') -> 'Point3':
+    return self.cal_intersection_point3(other)
`,105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_plane.md.DJ_9NQFz.lean.js b/assets/zht_api_mp_math_plane.md.CO3Dxqtg.lean.js similarity index 54% rename from assets/zht_api_mp_math_plane.md.DJ_9NQFz.lean.js rename to assets/zht_api_mp_math_plane.md.CO3Dxqtg.lean.js index 9b02a9f..2465fa4 100644 --- a/assets/zht_api_mp_math_plane.md.DJ_9NQFz.lean.js +++ b/assets/zht_api_mp_math_plane.md.CO3Dxqtg.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/plane.md","filePath":"zht/api/mp_math/plane.md"}'),l={name:"zht/api/mp_math/plane.md"},h=n("",105),t=[h];function p(k,e,r,d,E,o){return a(),i("div",null,t)}const y=s(l,[["render",p]]);export{F as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.plane","description":"","frontmatter":{"title":"mbcp.mp_math.plane","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/plane.md","filePath":"zht/api/mp_math/plane.md"}'),l={name:"zht/api/mp_math/plane.md"},t=n("",105),h=[t];function p(e,k,r,d,E,o){return a(),i("div",null,h)}const F=s(l,[["render",p]]);export{y as __pageData,F as default}; diff --git a/assets/zht_api_mp_math_point.md.D1nAiRP0.js b/assets/zht_api_mp_math_point.md.hahZSaSv.js similarity index 74% rename from assets/zht_api_mp_math_point.md.D1nAiRP0.js rename to assets/zht_api_mp_math_point.md.hahZSaSv.js index 006128b..5e0e63c 100644 --- a/assets/zht_api_mp_math_point.md.D1nAiRP0.js +++ b/assets/zht_api_mp_math_point.md.hahZSaSv.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/point.md","filePath":"zht/api/mp_math/point.md"}'),n={name:"zht/api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

變數説明:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源碼
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/point.md","filePath":"zht/api/mp_math/point.md"}'),n={name:"zht/api/mp_math/point.md"},l=t(`

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

變數説明:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源碼

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -18,11 +18,11 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源碼
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: P + V -> P P + P -> P

變數説明:

  • other:
源碼
python
def __add__(self, other):
+    ...

def self + other

説明: P + V -> P P + P -> P

變數説明:

  • other:
源碼

在GitHub上查看

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -30,14 +30,14 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

變數説明:

  • other:
源碼
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

變數説明:

  • other:
源碼
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

變數説明:

  • other:
源碼

在GitHub上查看

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -48,4 +48,4 @@ import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y
 
         """
     from .vector import Vector3
-    return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; + return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)
`,36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_mp_math_point.md.D1nAiRP0.lean.js b/assets/zht_api_mp_math_point.md.hahZSaSv.lean.js similarity index 68% rename from assets/zht_api_mp_math_point.md.D1nAiRP0.lean.js rename to assets/zht_api_mp_math_point.md.hahZSaSv.lean.js index 6468bc9..30d0b10 100644 --- a/assets/zht_api_mp_math_point.md.D1nAiRP0.lean.js +++ b/assets/zht_api_mp_math_point.md.hahZSaSv.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/point.md","filePath":"zht/api/mp_math/point.md"}'),n={name:"zht/api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,E){return a(),i("div",null,h)}const F=s(n,[["render",e]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/point.md","filePath":"zht/api/mp_math/point.md"}'),n={name:"zht/api/mp_math/point.md"},l=t("",36),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_mp_math_segment.md.CMRey-MG.js b/assets/zht_api_mp_math_segment.md.BVxd03II.js similarity index 82% rename from assets/zht_api_mp_math_segment.md.CMRey-MG.js rename to assets/zht_api_mp_math_segment.md.BVxd03II.js index 0e722a3..ff1d227 100644 --- a/assets/zht_api_mp_math_segment.md.CMRey-MG.js +++ b/assets/zht_api_mp_math_segment.md.BVxd03II.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/segment.md","filePath":"zht/api/mp_math/segment.md"}'),t={name:"zht/api/mp_math/segment.md"},h=n(`

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

源碼
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/segment.md","filePath":"zht/api/mp_math/segment.md"}'),t={name:"zht/api/mp_math/segment.md"},p=n(`

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

源碼

在GitHub上查看

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -11,4 +11,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     '长度'
     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)
`,6),p=[h];function l(e,k,r,d,E,g){return a(),i("div",null,p)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; + self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2)
`,6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/zht_api_mp_math_segment.md.CMRey-MG.lean.js b/assets/zht_api_mp_math_segment.md.BVxd03II.lean.js similarity index 59% rename from assets/zht_api_mp_math_segment.md.CMRey-MG.lean.js rename to assets/zht_api_mp_math_segment.md.BVxd03II.lean.js index e6d60ae..08c73d8 100644 --- a/assets/zht_api_mp_math_segment.md.CMRey-MG.lean.js +++ b/assets/zht_api_mp_math_segment.md.BVxd03II.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/segment.md","filePath":"zht/api/mp_math/segment.md"}'),t={name:"zht/api/mp_math/segment.md"},h=n("",6),p=[h];function l(e,k,r,d,E,g){return a(),i("div",null,p)}const y=s(t,[["render",l]]);export{o as __pageData,y as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/segment.md","filePath":"zht/api/mp_math/segment.md"}'),t={name:"zht/api/mp_math/segment.md"},p=n("",6),h=[p];function e(l,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",e]]);export{F as __pageData,y as default}; diff --git a/assets/zht_api_mp_math_utils.md.BDpW2Fd4.lean.js b/assets/zht_api_mp_math_utils.md.BDpW2Fd4.lean.js deleted file mode 100644 index e56152e..0000000 --- a/assets/zht_api_mp_math_utils.md.BDpW2Fd4.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/utils.md","filePath":"zht/api/mp_math/utils.md"}'),l={name:"zht/api/mp_math/utils.md"},t=n("",35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; diff --git a/assets/zht_api_mp_math_utils.md.BDpW2Fd4.js b/assets/zht_api_mp_math_utils.md.Dz7jYC2A.js similarity index 71% rename from assets/zht_api_mp_math_utils.md.BDpW2Fd4.js rename to assets/zht_api_mp_math_utils.md.Dz7jYC2A.js index d351925..f35c0ef 100644 --- a/assets/zht_api_mp_math_utils.md.BDpW2Fd4.js +++ b/assets/zht_api_mp_math_utils.md.Dz7jYC2A.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/utils.md","filePath":"zht/api/mp_math/utils.md"}'),l={name:"zht/api/mp_math/utils.md"},t=n(`

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

變數説明:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源碼
python
def clamp(x: float, min_: float, max_: float) -> float:
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/utils.md","filePath":"zht/api/mp_math/utils.md"}'),t={name:"zht/api/mp_math/utils.md"},l=n(`

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

變數説明:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源碼

在GitHub上查看

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -9,8 +9,8 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源碼
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

源碼
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源碼

在GitHub上查看

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

源碼

在GitHub上查看

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -20,9 +20,9 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

源碼
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

變數説明:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源碼
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

源碼

在GitHub上查看

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

def __ne__(self, other)

源碼

在GitHub上查看

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

變數説明:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -32,7 +32,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼

在GitHub上查看

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -45,7 +45,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼

在GitHub上查看

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -61,4 +61,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const E
     elif x < 0:
         return f'-{abs(x)}'
     else:
-        return ''
`,35),h=[t];function p(e,k,r,d,o,g){return a(),i("div",null,h)}const y=s(l,[["render",p]]);export{E as __pageData,y as default}; + return ''
`,35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/zht_api_mp_math_utils.md.Dz7jYC2A.lean.js b/assets/zht_api_mp_math_utils.md.Dz7jYC2A.lean.js new file mode 100644 index 0000000..b020cd3 --- /dev/null +++ b/assets/zht_api_mp_math_utils.md.Dz7jYC2A.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const F=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/utils.md","filePath":"zht/api/mp_math/utils.md"}'),t={name:"zht/api/mp_math/utils.md"},l=n("",35),h=[l];function p(e,k,r,o,d,g){return a(),i("div",null,h)}const E=s(t,[["render",p]]);export{F as __pageData,E as default}; diff --git a/assets/zht_api_mp_math_vector.md.DGVOQo3Y.js b/assets/zht_api_mp_math_vector.md.26fppi_c.js similarity index 76% rename from assets/zht_api_mp_math_vector.md.DGVOQo3Y.js rename to assets/zht_api_mp_math_vector.md.26fppi_c.js index 49dab6e..27df279 100644 --- a/assets/zht_api_mp_math_vector.md.DGVOQo3Y.js +++ b/assets/zht_api_mp_math_vector.md.26fppi_c.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/vector.md","filePath":"zht/api/mp_math/vector.md"}'),t={name:"zht/api/mp_math/vector.md"},l=n(`

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

變數説明:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源碼
python
def __init__(self, x: float, y: float, z: float):
+import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/vector.md","filePath":"zht/api/mp_math/vector.md"}'),n={name:"zht/api/mp_math/vector.md"},e=t(`

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

變數説明:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源碼

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -8,7 +8,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -18,7 +18,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

變數説明:

  • other: 另一个向量

返回: 夹角

源碼
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

變數説明:

  • other: 另一个向量

返回: 夹角

源碼

在GitHub上查看

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -26,7 +26,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

變數説明:

  • other:

返回: 行列式的结果

源碼
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

變數説明:

  • other:

返回: 行列式的结果

源碼

在GitHub上查看

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -46,7 +46,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

變數説明:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源碼
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

變數説明:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源碼

在GitHub上查看

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -55,7 +55,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

變數説明:

  • other: 另一个向量

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

變數説明:

  • other: 另一个向量

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -63,7 +63,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

源碼
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

源碼

在GitHub上查看

python
def normalize(self):
     """
         将向量归一化。
 
@@ -72,32 +72,32 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

源碼
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

源碼

在GitHub上查看

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

返回: 模

源碼
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

返回: 模

源碼

在GitHub上查看

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

返回: 单位向量

源碼
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

返回: 单位向量

源碼

在GitHub上查看

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

源碼
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

源碼
python
@overload
+    return self / self.length

def __abs__(self)

源碼

在GitHub上查看

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: V + P -> P

V + V -> V

變數説明:

  • other:
源碼
python
def __add__(self, other):
+    ...

def self + other

説明: V + P -> P

V + V -> V

變數説明:

  • other:
源碼

在GitHub上查看

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -112,7 +112,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

變數説明:

  • other:

返回: 是否相等

源碼
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

變數説明:

  • other:

返回: 是否相等

源碼

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -120,7 +120,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

源碼
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

源碼

在GitHub上查看

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -128,11 +128,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源碼
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

説明: V - P -> P

V - V -> V

變數説明:

  • other:
源碼
python
def __sub__(self, other):
+    ...

def self - other

説明: V - P -> P

V - V -> V

變數説明:

  • other:
源碼

在GitHub上查看

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -146,7 +146,7 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

變數説明:

  • other:
源碼
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

變數説明:

  • other:
源碼

在GitHub上查看

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -157,11 +157,11 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源碼
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

源碼
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

源碼

在GitHub上查看

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

變數説明:

  • other:
源碼
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -174,14 +174,14 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源碼
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

變數説明:

  • other:
源碼
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源碼

在GitHub上查看

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

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

var zero_vector3 = Vector3(0, 0, 0)

  • 類型: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 類型: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 類型: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 類型: Vector3

  • 説明: z轴单位向量

`,127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; + return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

源碼

在GitHub上查看

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

def - self

源碼

在GitHub上查看

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

var zero_vector3 = Vector3(0, 0, 0)

  • 類型: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 類型: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 類型: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 類型: Vector3

  • 説明: z轴单位向量

`,127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_mp_math_vector.md.26fppi_c.lean.js b/assets/zht_api_mp_math_vector.md.26fppi_c.lean.js new file mode 100644 index 0000000..e41837a --- /dev/null +++ b/assets/zht_api_mp_math_vector.md.26fppi_c.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a2 as t}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/vector.md","filePath":"zht/api/mp_math/vector.md"}'),n={name:"zht/api/mp_math/vector.md"},e=t("",127),h=[e];function l(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",l]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_mp_math_vector.md.DGVOQo3Y.lean.js b/assets/zht_api_mp_math_vector.md.DGVOQo3Y.lean.js deleted file mode 100644 index dd2cd98..0000000 --- a/assets/zht_api_mp_math_vector.md.DGVOQo3Y.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.mp_math.vector","description":"","frontmatter":{"title":"mbcp.mp_math.vector","editLink":false},"headers":[],"relativePath":"zht/api/mp_math/vector.md","filePath":"zht/api/mp_math/vector.md"}'),t={name:"zht/api/mp_math/vector.md"},l=n("",127),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const F=s(t,[["render",e]]);export{y as __pageData,F as default}; diff --git a/assets/zht_api_presets_model_index.md.BJWX_k6K.js b/assets/zht_api_presets_model_index.md.BN6GzTiL.js similarity index 92% rename from assets/zht_api_presets_model_index.md.BJWX_k6K.js rename to assets/zht_api_presets_model_index.md.BN6GzTiL.js index 2b61760..695da8a 100644 --- a/assets/zht_api_presets_model_index.md.BJWX_k6K.js +++ b/assets/zht_api_presets_model_index.md.BN6GzTiL.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/index.md","filePath":"zht/api/presets/model/index.md"}'),t={name:"zht/api/presets/model/index.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/index.md","filePath":"zht/api/presets/model/index.md"}'),t={name:"zht/api/presets/model/index.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_presets_model_index.md.BJWX_k6K.lean.js b/assets/zht_api_presets_model_index.md.BN6GzTiL.lean.js similarity index 63% rename from assets/zht_api_presets_model_index.md.BJWX_k6K.lean.js rename to assets/zht_api_presets_model_index.md.BN6GzTiL.lean.js index 664af76..6a3a681 100644 --- a/assets/zht_api_presets_model_index.md.BJWX_k6K.lean.js +++ b/assets/zht_api_presets_model_index.md.BN6GzTiL.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const o=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/index.md","filePath":"zht/api/presets/model/index.md"}'),t={name:"zht/api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{o as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/index.md","filePath":"zht/api/presets/model/index.md"}'),t={name:"zht/api/presets/model/index.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_presets_model_model.md.CNI4ubOh.js b/assets/zht_api_presets_model_model.md.pUtH2Ds8.js similarity index 92% rename from assets/zht_api_presets_model_model.md.CNI4ubOh.js rename to assets/zht_api_presets_model_model.md.pUtH2Ds8.js index c5d38ef..6629484 100644 --- a/assets/zht_api_presets_model_model.md.CNI4ubOh.js +++ b/assets/zht_api_presets_model_model.md.pUtH2Ds8.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/model.md","filePath":"zht/api/presets/model/model.md"}'),t={name:"zht/api/presets/model/model.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼
python
@staticmethod
+import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/model.md","filePath":"zht/api/presets/model/model.md"}'),t={name:"zht/api/presets/model/model.md"},h=n(`

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -15,4 +15,4 @@ import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y
     x_array = radius * np.sin(phi_list) * np.cos(theta_list)
     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)]
`,10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; + return [Point3(x_array[i], y_array[i], z_array[i]) for i in range(num)]
`,10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/assets/zht_api_presets_model_model.md.CNI4ubOh.lean.js b/assets/zht_api_presets_model_model.md.pUtH2Ds8.lean.js similarity index 76% rename from assets/zht_api_presets_model_model.md.CNI4ubOh.lean.js rename to assets/zht_api_presets_model_model.md.pUtH2Ds8.lean.js index 88126ad..90a9537 100644 --- a/assets/zht_api_presets_model_model.md.CNI4ubOh.lean.js +++ b/assets/zht_api_presets_model_model.md.pUtH2Ds8.lean.js @@ -1 +1 @@ -import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/model.md","filePath":"zht/api/presets/model/model.md"}'),t={name:"zht/api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,g){return a(),i("div",null,l)}const F=s(t,[["render",p]]);export{y as __pageData,F as default}; +import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.C94oF1kp.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","editLink":false,"collapsed":true},"headers":[],"relativePath":"zht/api/presets/model/model.md","filePath":"zht/api/presets/model/model.md"}'),t={name:"zht/api/presets/model/model.md"},h=n("",10),l=[h];function p(k,e,r,d,E,o){return a(),i("div",null,l)}const c=s(t,[["render",p]]);export{y as __pageData,c as default}; diff --git a/demo/index.html b/demo/index.html index d859f9b..ed55000 100644 --- a/demo/index.html +++ b/demo/index.html @@ -6,7 +6,7 @@ demo | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/en/api/api.html b/en/api/api.html index 0bac6da..338ecdb 100644 --- a/en/api/api.html +++ b/en/api/api.html @@ -6,7 +6,7 @@ mbcp | MBCP docs - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/en/api/index.html b/en/api/index.html index 3da45c5..90b7d02 100644 --- a/en/api/index.html +++ b/en/api/index.html @@ -6,7 +6,7 @@ mbcp | MBCP docs - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/en/api/mp_math/angle.html b/en/api/mp_math/angle.html index 8104c6f..f27a9a6 100644 --- a/en/api/mp_math/angle.html +++ b/en/api/mp_math/angle.html @@ -6,19 +6,19 @@ mbcp.mp_math.angle | MBCP docs - + - + -
Skip to content

mbcp.mp_math.angle

Description: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

Description: 任意角度。

Arguments:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
Source code
python
def __init__(self, value: float, is_radian: bool=False):
+    
Skip to content

mbcp.mp_math.angle

Description: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

Description: 任意角度。

Arguments:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
Source code

View on GitHub

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -28,96 +28,96 @@
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

Description: 余角:两角的和为90°。

Return: 余角

Source code
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

Description: 余角:两角的和为90°。

Return: 余角

Source code

View on GitHub

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

Description: 补角:两角的和为180°。

Return: 补角

Source code
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

Description: 补角:两角的和为180°。

Return: 补角

Source code

View on GitHub

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

Description: 角度。

Return: 弧度

Source code
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

Description: 角度。

Return: 弧度

Source code

View on GitHub

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

Description: 最小正角。

Return: 最小正角度

Source code
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

Description: 最小正角。

Return: 最小正角度

Source code

View on GitHub

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

Description: 最大负角。

Return: 最大负角度

Source code
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

Description: 最大负角。

Return: 最大负角度

Source code

View on GitHub

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

Description: 正弦值。

Return: 正弦值

Source code
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

Description: 正弦值。

Return: 正弦值

Source code

View on GitHub

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

Description: 余弦值。

Return: 余弦值

Source code
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

Description: 余弦值。

Return: 余弦值

Source code

View on GitHub

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

Description: 正切值。

Return: 正切值

Source code
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

Description: 正切值。

Return: 正切值

Source code

View on GitHub

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

Description: 余切值。

Return: 余切值

Source code
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

Description: 余切值。

Return: 余切值

Source code

View on GitHub

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

Description: 正割值。

Return: 正割值

Source code
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

Description: 正割值。

Return: 正割值

Source code

View on GitHub

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

Description: 余割值。

Return: 余割值

Source code
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

Description: 余割值。

Return: 余割值

Source code

View on GitHub

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

Source code
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

Source code
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

Source code
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

Source code
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

Source code

View on GitHub

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

Source code

View on GitHub

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

Source code

View on GitHub

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

Source code

View on GitHub

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

Source code

View on GitHub

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

Source code
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

Source code

View on GitHub

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

Source code
python
def __truediv__(self, other):
+    ...

def self / other

Source code

View on GitHub

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
     return AnyAngle(self.radian / other, is_radian=True)

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/const.html b/en/api/mp_math/const.html index fb943c2..b658d6f 100644 --- a/en/api/mp_math/const.html +++ b/en/api/mp_math/const.html @@ -6,7 +6,7 @@ mbcp.mp_math.const | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.const

Description: 本模块定义了一些常用的常量

var PI = math.pi

  • Description: 常量 π

var E = math.e

  • Description: 自然对数的底 exp(1)

var GOLDEN_RATIO = (1 + math.sqrt(5)) / 2

  • Description: 黄金分割比

var GAMMA = 0.5772156649015329

  • Description: 欧拉常数

var EPSILON = 0.0001

  • Description: 精度误差

var APPROX = 0.001

  • Description: 约等于判定误差

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/equation.html b/en/api/mp_math/equation.html index 8e17bd3..03446b3 100644 --- a/en/api/mp_math/equation.html +++ b/en/api/mp_math/equation.html @@ -6,19 +6,19 @@ mbcp.mp_math.equation | MBCP docs - + - + -
Skip to content

mbcp.mp_math.equation

Description: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+    
Skip to content

mbcp.mp_math.equation

Description: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

Description: 曲线方程。

Arguments:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
Source code

View on GitHub

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:

Return: 目标点

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

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

Description: 计算曲线上的点。

Arguments:

  • *t:
  • 参数:

Return: 目标点

Source code

View on GitHub

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -40,7 +40,7 @@
     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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = 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:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

Arguments:

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

Return: 偏导函数

Raises:

  • ValueError 无效变量类型
Source code

View on GitHub

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -83,7 +83,7 @@
         return high_order_partial_derivative_func
     else:
         raise ValueError('Invalid var type')

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/function.html b/en/api/mp_math/function.html index 75a7973..c8e598b 100644 --- a/en/api/mp_math/function.html +++ b/en/api/mp_math/function.html @@ -6,19 +6,19 @@ mbcp.mp_math.function | MBCP docs - + - + -
Skip to content

mbcp.mp_math.function

Description: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

Description: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

Arguments:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

Return: 梯度

Source code
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+    
Skip to content

mbcp.mp_math.function

Description: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

Description: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

Arguments:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

Return: 梯度

Source code

View on GitHub

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -37,7 +37,7 @@
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

Arguments:

  • func: 函数
  • *args: 参数

Return: 柯里化后的函数

Examples:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
Source code
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
Source code

View on GitHub

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -60,7 +60,7 @@
         """@litedoc-hide"""
         return func(*args, *args2)
     return curried_func

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/index.html b/en/api/mp_math/index.html index 4098a66..9c29bb9 100644 --- a/en/api/mp_math/index.html +++ b/en/api/mp_math/index.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

Description: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/line.html b/en/api/mp_math/line.html index 66833a7..0a03f81 100644 --- a/en/api/mp_math/line.html +++ b/en/api/mp_math/line.html @@ -6,19 +6,19 @@ mbcp.mp_math.line | MBCP docs - + - + -
Skip to content

mbcp.mp_math.line

Description: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

Description: 三维空间中的直线。由一个点和一个方向向量确定。

Arguments:

  • point: 直线上的一点
  • direction: 直线的方向向量
Source code
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+    
Skip to content

mbcp.mp_math.line

Description: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

Description: 三维空间中的直线。由一个点和一个方向向量确定。

Arguments:

  • point: 直线上的一点
  • direction: 直线的方向向量
Source code

View on GitHub

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -26,7 +26,7 @@
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

Description: 判断两条直线是否近似相等。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似相等

Source code
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

Description: 判断两条直线是否近似相等。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -35,7 +35,7 @@
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

Description: 计算直线和直线之间的夹角。

Arguments:

  • other: 另一条直线

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

Description: 计算直线和直线之间的夹角。

Arguments:

  • other: 另一条直线

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -45,7 +45,7 @@
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

Description: 计算直线和直线或点之间的距离。

Arguments:

  • other: 平行直线或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

Description: 计算直线和直线或点之间的距离。

Arguments:

  • other: 平行直线或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -68,7 +68,7 @@
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

Description: 计算两条直线的交点。

Arguments:

  • other: 另一条直线

Return: 交点

Raises:

  • ValueError 直线平行
  • ValueError 直线不共面
Source code
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

Description: 计算两条直线的交点。

Arguments:

  • other: 另一条直线

Return: 交点

Raises:

  • ValueError 直线平行
  • ValueError 直线不共面
Source code

View on GitHub

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -83,7 +83,7 @@
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

Description: 计算直线经过指定点p的垂线。

Arguments:

  • point: 指定点

Return: 垂线

Source code
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

Description: 计算直线经过指定点p的垂线。

Arguments:

  • point: 指定点

Return: 垂线

Source code

View on GitHub

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -91,7 +91,7 @@
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

Description: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

Arguments:

  • t: 参数t

Return: 点

Source code
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

Description: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

Arguments:

  • t: 参数t

Return: 点

Source code

View on GitHub

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -99,13 +99,13 @@
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

Description: 获取直线的参数方程。

Return: x(t), y(t), z(t)

Source code
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

Description: 获取直线的参数方程。

Return: x(t), y(t), z(t)

Source code

View on GitHub

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

Description: 判断两条直线是否近似平行。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似平行

Source code
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

Description: 判断两条直线是否近似平行。

Arguments:

  • other: 另一条直线
  • epsilon: 误差

Return: 是否近似平行

Source code

View on GitHub

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -114,7 +114,7 @@
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

Description: 判断两条直线是否平行。

Arguments:

  • other: 另一条直线

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

Description: 判断两条直线是否平行。

Arguments:

  • other: 另一条直线

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -122,7 +122,7 @@
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

Description: 判断两条直线是否共线。

Arguments:

  • other: 另一条直线

Return: 是否共线

Source code
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

Description: 判断两条直线是否共线。

Arguments:

  • other: 另一条直线

Return: 是否共线

Source code

View on GitHub

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -130,7 +130,7 @@
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

Description: 判断点是否在直线上。

Arguments:

  • point: 点

Return: 是否在直线上

Source code
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

Description: 判断点是否在直线上。

Arguments:

  • point: 点

Return: 是否在直线上

Source code

View on GitHub

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -138,7 +138,7 @@
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

Description: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

Arguments:

  • other: 另一条直线

Return: 是否共面

Source code
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

Description: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

Arguments:

  • other: 另一条直线

Return: 是否共面

Source code

View on GitHub

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -147,7 +147,7 @@
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

Description: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

Source code
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

Description: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

Source code

View on GitHub

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -160,7 +160,7 @@
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

Description: 工厂函数 由两点构造直线。

Arguments:

  • p1: 点1
  • p2: 点2

Return: 直线

Source code
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

Description: 工厂函数 由两点构造直线。

Arguments:

  • p1: 点1
  • p2: 点2

Return: 直线

Source code

View on GitHub

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -171,7 +171,7 @@
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

Description: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

Arguments:

  • other: 另一条直线

Return: 交点

Source code
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

Description: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

Arguments:

  • other: 另一条直线

Return: 交点

Source code

View on GitHub

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -184,7 +184,7 @@
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

Description: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

Arguments:

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

def __eq__(self, other) -> bool

Description: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

Arguments:

  • other:
Source code

View on GitHub

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -196,7 +196,7 @@
 
         """
     return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/mp_math.html b/en/api/mp_math/mp_math.html index b3b0dd3..a669195 100644 --- a/en/api/mp_math/mp_math.html +++ b/en/api/mp_math/mp_math.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

Description: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

Documentation built with VitePress | API references generated by litedoc

- + \ 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 5b128d1..6d4980c 100644 --- a/en/api/mp_math/mp_math_typing.html +++ b/en/api/mp_math/mp_math_typing.html @@ -6,7 +6,7 @@ mbcp.mp_math.mp_math_typing | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.mp_math_typing

Description: 本模块用于内部类型提示

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: 多元函数

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/plane.html b/en/api/mp_math/plane.html index b549a3d..8ce0468 100644 --- a/en/api/mp_math/plane.html +++ b/en/api/mp_math/plane.html @@ -6,19 +6,19 @@ mbcp.mp_math.plane | MBCP docs - + - + -
Skip to content

mbcp.mp_math.plane

Description: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

Description: 平面方程:ax + by + cz + d = 0

Arguments:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
Source code
python
def __init__(self, a: float, b: float, c: float, d: float):
+    
Skip to content

mbcp.mp_math.plane

Description: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

Description: 平面方程:ax + by + cz + d = 0

Arguments:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
Source code

View on GitHub

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -30,7 +30,7 @@
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

Description: 判断两个平面是否近似相等。

Arguments:

  • other: 另一个平面

Return: 是否近似相等

Source code
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

Description: 判断两个平面是否近似相等。

Arguments:

  • other: 另一个平面

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -48,7 +48,7 @@
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

Description: 计算平面与平面之间的夹角。

Arguments:

  • other: 另一个平面

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

Description: 计算平面与平面之间的夹角。

Arguments:

  • other: 另一个平面

Return: 夹角弧度

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -63,7 +63,7 @@
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

Description: 计算平面与平面或点之间的距离。

Arguments:

  • other: 另一个平面或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

Description: 计算平面与平面或点之间的距离。

Arguments:

  • other: 另一个平面或点

Return: 距离

Raises:

  • TypeError 不支持的类型
Source code

View on GitHub

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -78,7 +78,7 @@
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

Description: 计算两平面的交线。

Arguments:

  • other: 另一个平面

Return: 两平面的交线

Source code
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

Description: 计算两平面的交线。

Arguments:

  • other: 另一个平面

Return: 两平面的交线

Source code

View on GitHub

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -103,7 +103,7 @@
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

Description: 计算平面与直线的交点。

Arguments:

  • other: 不与平面平行或在平面上的直线

Return: 交点

Raises:

  • ValueError 平面与直线平行或重合
Source code
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

Description: 计算平面与直线的交点。

Arguments:

  • other: 不与平面平行或在平面上的直线

Return: 交点

Raises:

  • ValueError 平面与直线平行或重合
Source code

View on GitHub

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -117,7 +117,7 @@
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

Description: 计算平行于该平面且过指定点的平面。

Arguments:

  • point: 指定点

Return: 所求平面

Source code
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

Description: 计算平行于该平面且过指定点的平面。

Arguments:

  • point: 指定点

Return: 所求平面

Source code

View on GitHub

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -125,7 +125,7 @@
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

Description: 判断两个平面是否平行。

Arguments:

  • other: 另一个平面

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

Description: 判断两个平面是否平行。

Arguments:

  • other: 另一个平面

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -133,14 +133,14 @@
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

Description: 平面的法向量。

Return: 法向量

Source code
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

Description: 平面的法向量。

Return: 法向量

Source code

View on GitHub

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

Description: 工厂函数 由点和法向量构造平面(点法式构造)。

Arguments:

  • point: 平面上的一点
  • normal: 法向量

Return: 平面

Source code
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

Description: 工厂函数 由点和法向量构造平面(点法式构造)。

Arguments:

  • point: 平面上的一点
  • normal: 法向量

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -152,7 +152,7 @@
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

Description: 工厂函数 由三点构造平面。

Arguments:

  • p1: 点1
  • p2: 点2
  • p3: 点3

Return: 平面

Source code
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

Description: 工厂函数 由三点构造平面。

Arguments:

  • p1: 点1
  • p2: 点2
  • p3: 点3

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -166,7 +166,7 @@
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

Description: 工厂函数 由两直线构造平面。

Arguments:

  • l1: 直线1
  • l2: 直线2

Return: 平面

Source code
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

Description: 工厂函数 由两直线构造平面。

Arguments:

  • l1: 直线1
  • l2: 直线2

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -180,7 +180,7 @@
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

Description: 工厂函数 由点和直线构造平面。

Arguments:

  • point: 面上一点
  • line: 面上直线,不包含点

Return: 平面

Source code
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

Description: 工厂函数 由点和直线构造平面。

Arguments:

  • point: 面上一点
  • line: 面上直线,不包含点

Return: 平面

Source code

View on GitHub

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -190,11 +190,11 @@
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

Source code
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

Source code

View on GitHub

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

Source code
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

Source code

View on GitHub

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

Description: 取两平面的交集(人话:交线)

Arguments:

  • other:

Return: 不平行平面的交线,平面平行返回None

Source code
python
def __and__(self, other):
+    ...

def __and__(self, other)

Description: 取两平面的交集(人话:交线)

Arguments:

  • other:

Return: 不平行平面的交线,平面平行返回None

Source code

View on GitHub

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -211,10 +211,10 @@
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

Source code
python
def __rand__(self, other: 'Line3') -> 'Point3':
+        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

Source code

View on GitHub

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

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

Source code

View on GitHub

python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/point.html b/en/api/mp_math/point.html index 205ab70..ab640b4 100644 --- a/en/api/mp_math/point.html +++ b/en/api/mp_math/point.html @@ -6,19 +6,19 @@ mbcp.mp_math.point | MBCP docs - + - + -
Skip to content

mbcp.mp_math.point

Description: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

Description: 笛卡尔坐标系中的点。

Arguments:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
Source code
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.point

Description: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

Description: 笛卡尔坐标系中的点。

Arguments:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
Source code

View on GitHub

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

Description: 判断两个点是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

Description: 判断两个点是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -38,11 +38,11 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

Source code
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

Description: P + V -> P P + P -> P

Arguments:

  • other:
Source code
python
def __add__(self, other):
+    ...

def self + other

Description: P + V -> P P + P -> P

Arguments:

  • other:
Source code

View on GitHub

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -50,14 +50,14 @@
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

Description: 判断两个点是否相等。

Arguments:

  • other:
Source code
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

Description: 判断两个点是否相等。

Arguments:

  • other:
Source code

View on GitHub

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

Description: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

Arguments:

  • other:
Source code
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

Description: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

Arguments:

  • other:
Source code

View on GitHub

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -69,7 +69,7 @@
         """
     from .vector import Vector3
     return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/segment.html b/en/api/mp_math/segment.html index d4fcc9a..8b5cc9a 100644 --- a/en/api/mp_math/segment.html +++ b/en/api/mp_math/segment.html @@ -6,19 +6,19 @@ mbcp.mp_math.segment | MBCP docs - + - + -
Skip to content

mbcp.mp_math.segment

Description: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

Description: 三维空间中的线段。 :param p1: :param p2:

Source code
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+    
Skip to content

mbcp.mp_math.segment

Description: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

Description: 三维空间中的线段。 :param p1: :param p2:

Source code

View on GitHub

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -32,7 +32,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)

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/utils.html b/en/api/mp_math/utils.html index 6b8d57d..12d1df7 100644 --- a/en/api/mp_math/utils.html +++ b/en/api/mp_math/utils.html @@ -6,19 +6,19 @@ mbcp.mp_math.utils | MBCP docs - + - + -
Skip to content

mbcp.mp_math.utils

Description: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

Description: 区间限定函数

Arguments:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

Return: 限制后的值

Source code
python
def clamp(x: float, min_: float, max_: float) -> float:
+    
Skip to content

mbcp.mp_math.utils

Description: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

Description: 区间限定函数

Arguments:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

Return: 限制后的值

Source code

View on GitHub

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -29,8 +29,8 @@
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

Source code
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

Source code
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

Source code

View on GitHub

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

Source code

View on GitHub

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -40,9 +40,9 @@
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def 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)}')

def __ne__(self, other)

Source code
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

Description: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

Arguments:

  • x: 数1
  • y: 数2
  • epsilon: 误差

Return: 是否近似相等

Source code
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

Source code

View on GitHub

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

def __ne__(self, other)

Source code

View on GitHub

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

Description: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

Arguments:

  • x: 数1
  • y: 数2
  • epsilon: 误差

Return: 是否近似相等

Source code

View on GitHub

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -52,7 +52,7 @@
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

Description: 获取数的符号。

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

Description: 获取数的符号。

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code

View on GitHub

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -65,7 +65,7 @@
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

Description: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

Description: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

Arguments:

  • x: 数
  • only_neg: 是否只返回负数的符号

Return: 符号 + - ""

Source code

View on GitHub

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -82,7 +82,7 @@
         return f'-{abs(x)}'
     else:
         return ''

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/mp_math/vector.html b/en/api/mp_math/vector.html index 599447b..1380c95 100644 --- a/en/api/mp_math/vector.html +++ b/en/api/mp_math/vector.html @@ -6,19 +6,19 @@ mbcp.mp_math.vector | MBCP docs - + - + -
Skip to content

mbcp.mp_math.vector

Description: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

Description: 3维向量

Arguments:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
Source code
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.vector

Description: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

Description: 3维向量

Arguments:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
Source code

View on GitHub

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似相等。

Arguments:

  • other:
  • epsilon:

Return: 是否近似相等

Source code

View on GitHub

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -38,7 +38,7 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

Description: 计算两个向量之间的夹角。

Arguments:

  • other: 另一个向量

Return: 夹角

Source code
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

Description: 计算两个向量之间的夹角。

Arguments:

  • other: 另一个向量

Return: 夹角

Source code

View on GitHub

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -46,7 +46,7 @@
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

Description: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

Arguments:

  • other:

Return: 行列式的结果

Source code
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

Description: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

Arguments:

  • other:

Return: 行列式的结果

Source code

View on GitHub

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -66,7 +66,7 @@
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似平行。

Arguments:

  • other: 另一个向量
  • epsilon: 允许的误差

Return: 是否近似平行

Source code
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

Description: 判断两个向量是否近似平行。

Arguments:

  • other: 另一个向量
  • epsilon: 允许的误差

Return: 是否近似平行

Source code

View on GitHub

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -75,7 +75,7 @@
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

Description: 判断两个向量是否平行。

Arguments:

  • other: 另一个向量

Return: 是否平行

Source code
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

Description: 判断两个向量是否平行。

Arguments:

  • other: 另一个向量

Return: 是否平行

Source code

View on GitHub

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -83,7 +83,7 @@
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

Description: 将向量归一化。

自体归一化,不返回值。

Source code
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

Description: 将向量归一化。

自体归一化,不返回值。

Source code

View on GitHub

python
def normalize(self):
     """
         将向量归一化。
 
@@ -92,32 +92,32 @@
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

Source code
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

Source code

View on GitHub

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

Description: 向量的模。

Return: 模

Source code
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

Description: 向量的模。

Return: 模

Source code

View on GitHub

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

Description: 获取该向量的单位向量。

Return: 单位向量

Source code
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

Description: 获取该向量的单位向量。

Return: 单位向量

Source code

View on GitHub

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

Source code
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

Source code
python
@overload
+    return self / self.length

def __abs__(self)

Source code

View on GitHub

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

Description: V + P -> P

V + V -> V

Arguments:

  • other:
Source code
python
def __add__(self, other):
+    ...

def self + other

Description: V + P -> P

V + V -> V

Arguments:

  • other:
Source code

View on GitHub

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -132,7 +132,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

Description: 判断两个向量是否相等。

Arguments:

  • other:

Return: 是否相等

Source code
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

Description: 判断两个向量是否相等。

Arguments:

  • other:

Return: 是否相等

Source code

View on GitHub

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -140,7 +140,7 @@
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

Description: P + V -> P

别去点那边实现了。 :param other: :return:

Source code
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

Description: P + V -> P

别去点那边实现了。 :param other: :return:

Source code

View on GitHub

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -148,11 +148,11 @@
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

Source code
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

Source code
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

Source code

View on GitHub

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

Description: V - P -> P

V - V -> V

Arguments:

  • other:
Source code
python
def __sub__(self, other):
+    ...

def self - other

Description: V - P -> P

V - V -> V

Arguments:

  • other:
Source code

View on GitHub

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -166,7 +166,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

Description: P - V -> P

Arguments:

  • other:
Source code
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

Description: P - V -> P

Arguments:

  • other:
Source code

View on GitHub

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -177,11 +177,11 @@
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

Source code
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

Source code

View on GitHub

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

Source code
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

Source code

View on GitHub

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

Description: 数组运算 非点乘。点乘使用@,叉乘使用cross。

Arguments:

  • other:
Source code
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

Description: 数组运算 非点乘。点乘使用@,叉乘使用cross。

Arguments:

  • other:
Source code

View on GitHub

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -194,18 +194,18 @@
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

Source code
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

Description: 点乘。

Arguments:

  • other:
Source code
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

Source code

View on GitHub

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

Description: 点乘。

Arguments:

  • other:
Source code

View on GitHub

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

Source code
python
def __neg__(self):
+    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

Source code

View on GitHub

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

def - self

Source code

View on GitHub

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

var zero_vector3 = Vector3(0, 0, 0)

  • Type: Vector3

  • Description: 零向量

var x_axis = Vector3(1, 0, 0)

  • Type: Vector3

  • Description: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • Type: Vector3

  • Description: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • Type: Vector3

  • Description: z轴单位向量

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/particle/index.html b/en/api/particle/index.html index d65aa49..7694dfc 100644 --- a/en/api/particle/index.html +++ b/en/api/particle/index.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP docs - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/en/api/particle/particle.html b/en/api/particle/particle.html index 83f37db..e518a42 100644 --- a/en/api/particle/particle.html +++ b/en/api/particle/particle.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP docs - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/en/api/presets/index.html b/en/api/presets/index.html index bfaa96a..0d15279 100644 --- a/en/api/presets/index.html +++ b/en/api/presets/index.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

Description: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/presets/model/index.html b/en/api/presets/model/index.html index 19ca9e8..0515fc2 100644 --- a/en/api/presets/model/index.html +++ b/en/api/presets/model/index.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP docs - + - + -
Skip to content

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code
python
@staticmethod
+    
Skip to content

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code

View on GitHub

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/presets/model/model.html b/en/api/presets/model/model.html index b1481a0..9617e9e 100644 --- a/en/api/presets/model/model.html +++ b/en/api/presets/model/model.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP docs - + - + -
Skip to content

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code
python
@staticmethod
+    
Skip to content

mbcp.presets.model

Description: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

Description: 生成球体上的点集。

Arguments:

  • radius:
  • density:

Return: List[Point3]: 球体上的点集。

Source code

View on GitHub

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/api/presets/presets.html b/en/api/presets/presets.html index e7b16ea..6e20cad 100644 --- a/en/api/presets/presets.html +++ b/en/api/presets/presets.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

Description: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/guide/index.html b/en/guide/index.html index 3b695d7..4848359 100644 --- a/en/guide/index.html +++ b/en/guide/index.html @@ -6,7 +6,7 @@ 开始不了一点 | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

开始不了一点

12x111

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/index.html b/en/index.html index b6f1dcd..9a9190f 100644 --- a/en/index.html +++ b/en/index.html @@ -6,7 +6,7 @@ MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

MBCP

More basic change particle

A Library for Python to create Minecraft particle effects and geometric figures

MBCP logo

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/en/refer/index.html b/en/refer/index.html index 2c5c827..349470f 100644 --- a/en/refer/index.html +++ b/en/refer/index.html @@ -6,7 +6,7 @@ Reference | MBCP docs - + @@ -19,7 +19,7 @@
Skip to content

Reference

help us to improve the documentation

Documentation built with VitePress | API references generated by litedoc

- + \ No newline at end of file diff --git a/guide/index.html b/guide/index.html index 5435f76..a547676 100644 --- a/guide/index.html +++ b/guide/index.html @@ -6,7 +6,7 @@ 开始不了一点 | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

开始不了一点

12x111

AAA

BBB

C

ddd

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index 4ebd454..7140852 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"api_api.md":"D_B0Hlcp","api_index.md":"C_wESrrY","api_mp_math_angle.md":"vKQLLqTS","api_mp_math_const.md":"BAf8mK4W","api_mp_math_equation.md":"B2FeM0MH","api_mp_math_function.md":"BnSMoIoo","api_mp_math_index.md":"BNf7bQqL","api_mp_math_line.md":"DPWL9O-M","api_mp_math_mp_math.md":"GlFMkWiQ","api_mp_math_mp_math_typing.md":"DlnJmkos","api_mp_math_plane.md":"DTAJAb0P","api_mp_math_point.md":"vtgIded6","api_mp_math_segment.md":"D-8aRB8W","api_mp_math_utils.md":"DaaoR634","api_mp_math_vector.md":"BTnPeAKR","api_particle_index.md":"Cm3Vk-es","api_particle_particle.md":"yD6tcNSr","api_presets_index.md":"CD62I2gv","api_presets_model_index.md":"gO0Notp6","api_presets_model_model.md":"s8f68j_n","api_presets_presets.md":"4R0VRbQo","demo_index.md":"D-H9zRUE","en_api_api.md":"BSgrCX1d","en_api_index.md":"Dj_5nFTt","en_api_mp_math_angle.md":"Bu07wjnV","en_api_mp_math_const.md":"gGpXUShq","en_api_mp_math_equation.md":"vEMIOITc","en_api_mp_math_function.md":"BWhqj_9Y","en_api_mp_math_index.md":"BEjLBMpH","en_api_mp_math_line.md":"BGq09mco","en_api_mp_math_mp_math.md":"D6ihYPav","en_api_mp_math_mp_math_typing.md":"Dnl2aJQ4","en_api_mp_math_plane.md":"C3KPGKE4","en_api_mp_math_point.md":"D7ZdR7VM","en_api_mp_math_segment.md":"DMW-YUfw","en_api_mp_math_utils.md":"B3i5gz_2","en_api_mp_math_vector.md":"CgtIoM4A","en_api_particle_index.md":"BfyNQiRg","en_api_particle_particle.md":"BNkfEyJn","en_api_presets_index.md":"BWb2fpTg","en_api_presets_model_index.md":"pbEu-669","en_api_presets_model_model.md":"CL5uKZbj","en_api_presets_presets.md":"CCUzsYog","en_guide_index.md":"DrDHTYCZ","en_index.md":"BSTSOH39","en_refer_index.md":"alw4L-bp","guide_index.md":"Cfmzk2IH","index.md":"CNF8LJa0","ja_api_api.md":"CPz58qIw","ja_api_index.md":"CnUeuifx","ja_api_mp_math_angle.md":"DTK1PNuJ","ja_api_mp_math_const.md":"DGXAgDfn","ja_api_mp_math_equation.md":"D-4BBsnQ","ja_api_mp_math_function.md":"Bvf1U09A","ja_api_mp_math_index.md":"CTZZ-p9Z","ja_api_mp_math_line.md":"DYJV4KNE","ja_api_mp_math_mp_math.md":"D-prC0UO","ja_api_mp_math_mp_math_typing.md":"BNymgrCT","ja_api_mp_math_plane.md":"D-yHaxP-","ja_api_mp_math_point.md":"DjHRkHI5","ja_api_mp_math_segment.md":"37V8kAc1","ja_api_mp_math_utils.md":"BbdhM1tp","ja_api_mp_math_vector.md":"BBVnCwJa","ja_api_particle_index.md":"Jr41Y3TS","ja_api_particle_particle.md":"exTt46pq","ja_api_presets_index.md":"CQqdQbIZ","ja_api_presets_model_index.md":"C-Ypf-qh","ja_api_presets_model_model.md":"Dwbc1qIc","ja_api_presets_presets.md":"DwzXdDqR","ja_guide_index.md":"BxGnZYwR","ja_index.md":"DCWiTENz","ja_refer_index.md":"CODW6iMX","refer_function_curry.md":"DwKZawp5","refer_function_function.md":"D3IgfZX2","refer_index.md":"CczYTl3j","zht_api_api.md":"DyUSHA0S","zht_api_index.md":"CgZH6aHQ","zht_api_mp_math_angle.md":"lzcXwnW6","zht_api_mp_math_const.md":"xwQvuYck","zht_api_mp_math_equation.md":"BAr_ktNP","zht_api_mp_math_function.md":"C2Gp7z0v","zht_api_mp_math_index.md":"mmeMMriu","zht_api_mp_math_line.md":"DX62bgjZ","zht_api_mp_math_mp_math.md":"C302rxKc","zht_api_mp_math_mp_math_typing.md":"CNiSnuMw","zht_api_mp_math_plane.md":"DJ_9NQFz","zht_api_mp_math_point.md":"D1nAiRP0","zht_api_mp_math_segment.md":"CMRey-MG","zht_api_mp_math_utils.md":"BDpW2Fd4","zht_api_mp_math_vector.md":"DGVOQo3Y","zht_api_particle_index.md":"8GaGB1ul","zht_api_particle_particle.md":"huuRTEb9","zht_api_presets_index.md":"DvOViSox","zht_api_presets_model_index.md":"BJWX_k6K","zht_api_presets_model_model.md":"CNI4ubOh","zht_api_presets_presets.md":"CsDHjRbK","zht_guide_index.md":"CsuFVFxu","zht_index.md":"VMjJ0lpj","zht_refer_index.md":"Bz6voxEQ"} +{"api_api.md":"D_B0Hlcp","api_index.md":"C_wESrrY","api_mp_math_angle.md":"bQbgL5rc","api_mp_math_const.md":"BAf8mK4W","api_mp_math_equation.md":"hWRUu0yD","api_mp_math_function.md":"C9eBzKgT","api_mp_math_index.md":"BNf7bQqL","api_mp_math_line.md":"DDkzT0e0","api_mp_math_mp_math.md":"GlFMkWiQ","api_mp_math_mp_math_typing.md":"DlnJmkos","api_mp_math_plane.md":"DCL3lFbz","api_mp_math_point.md":"Y0Sc19zU","api_mp_math_segment.md":"B-ptCnQ0","api_mp_math_utils.md":"mUQ56HGQ","api_mp_math_vector.md":"BeAN7TkI","api_particle_index.md":"Cm3Vk-es","api_particle_particle.md":"yD6tcNSr","api_presets_index.md":"CD62I2gv","api_presets_model_index.md":"BGeoOSCd","api_presets_model_model.md":"D34eFRNH","api_presets_presets.md":"4R0VRbQo","demo_index.md":"D-H9zRUE","en_api_api.md":"BSgrCX1d","en_api_index.md":"Dj_5nFTt","en_api_mp_math_angle.md":"Cj4ayIet","en_api_mp_math_const.md":"gGpXUShq","en_api_mp_math_equation.md":"BihILJCI","en_api_mp_math_function.md":"BR29hv60","en_api_mp_math_index.md":"BEjLBMpH","en_api_mp_math_line.md":"CIOnk8LF","en_api_mp_math_mp_math.md":"D6ihYPav","en_api_mp_math_mp_math_typing.md":"Dnl2aJQ4","en_api_mp_math_plane.md":"Cbmy4F0P","en_api_mp_math_point.md":"szYqVNff","en_api_mp_math_segment.md":"CqlcAra1","en_api_mp_math_utils.md":"CigCGgjm","en_api_mp_math_vector.md":"CF4kCv-W","en_api_particle_index.md":"BfyNQiRg","en_api_particle_particle.md":"BNkfEyJn","en_api_presets_index.md":"BWb2fpTg","en_api_presets_model_index.md":"Cnn4t_P0","en_api_presets_model_model.md":"BZpQe5Li","en_api_presets_presets.md":"CCUzsYog","en_guide_index.md":"DrDHTYCZ","en_index.md":"BSTSOH39","en_refer_index.md":"alw4L-bp","guide_index.md":"Cfmzk2IH","index.md":"CNF8LJa0","ja_api_api.md":"CPz58qIw","ja_api_index.md":"CnUeuifx","ja_api_mp_math_angle.md":"D0ChdV9L","ja_api_mp_math_const.md":"DGXAgDfn","ja_api_mp_math_equation.md":"ksLzfPHD","ja_api_mp_math_function.md":"S4mlhSEl","ja_api_mp_math_index.md":"CTZZ-p9Z","ja_api_mp_math_line.md":"C6_h0EEF","ja_api_mp_math_mp_math.md":"D-prC0UO","ja_api_mp_math_mp_math_typing.md":"BNymgrCT","ja_api_mp_math_plane.md":"CVfLX9sr","ja_api_mp_math_point.md":"21gM893G","ja_api_mp_math_segment.md":"Dji9_vOI","ja_api_mp_math_utils.md":"DhvjDskn","ja_api_mp_math_vector.md":"DyGgurm4","ja_api_particle_index.md":"Jr41Y3TS","ja_api_particle_particle.md":"exTt46pq","ja_api_presets_index.md":"CQqdQbIZ","ja_api_presets_model_index.md":"Dbt3LFNK","ja_api_presets_model_model.md":"ti1HKQyY","ja_api_presets_presets.md":"DwzXdDqR","ja_guide_index.md":"BxGnZYwR","ja_index.md":"DCWiTENz","ja_refer_index.md":"CODW6iMX","refer_function_curry.md":"DwKZawp5","refer_function_function.md":"D3IgfZX2","refer_index.md":"CczYTl3j","zht_api_api.md":"DyUSHA0S","zht_api_index.md":"CgZH6aHQ","zht_api_mp_math_angle.md":"ByT5Hatc","zht_api_mp_math_const.md":"xwQvuYck","zht_api_mp_math_equation.md":"C9JJo8Tj","zht_api_mp_math_function.md":"CUiziArf","zht_api_mp_math_index.md":"mmeMMriu","zht_api_mp_math_line.md":"TSJBrHTa","zht_api_mp_math_mp_math.md":"C302rxKc","zht_api_mp_math_mp_math_typing.md":"CNiSnuMw","zht_api_mp_math_plane.md":"CO3Dxqtg","zht_api_mp_math_point.md":"hahZSaSv","zht_api_mp_math_segment.md":"BVxd03II","zht_api_mp_math_utils.md":"Dz7jYC2A","zht_api_mp_math_vector.md":"26fppi_c","zht_api_particle_index.md":"8GaGB1ul","zht_api_particle_particle.md":"huuRTEb9","zht_api_presets_index.md":"DvOViSox","zht_api_presets_model_index.md":"BN6GzTiL","zht_api_presets_model_model.md":"pUtH2Ds8","zht_api_presets_presets.md":"CsDHjRbK","zht_guide_index.md":"CsuFVFxu","zht_index.md":"VMjJ0lpj","zht_refer_index.md":"Bz6voxEQ"} diff --git a/index.html b/index.html index bcedc8b..2356727 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

MBCP

更多基础变换粒子

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

MBCP logo

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/ja/api/api.html b/ja/api/api.html index 539447f..5cb4201 100644 --- a/ja/api/api.html +++ b/ja/api/api.html @@ -6,7 +6,7 @@ mbcp | MBCP ドキュメント - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/ja/api/index.html b/ja/api/index.html index 3668aea..e9427c6 100644 --- a/ja/api/index.html +++ b/ja/api/index.html @@ -6,7 +6,7 @@ mbcp | MBCP ドキュメント - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/ja/api/mp_math/angle.html b/ja/api/mp_math/angle.html index 6551d99..d9bc4f9 100644 --- a/ja/api/mp_math/angle.html +++ b/ja/api/mp_math/angle.html @@ -6,19 +6,19 @@ mbcp.mp_math.angle | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

引数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
ソースコード
python
def __init__(self, value: float, is_radian: bool=False):
+    
Skip to content

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

引数:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
ソースコード

GitHubで表示

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -28,96 +28,96 @@
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

戻り値: 余角

ソースコード
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

戻り値: 余角

ソースコード

GitHubで表示

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

戻り値: 补角

ソースコード
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

戻り値: 补角

ソースコード

GitHubで表示

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

戻り値: 弧度

ソースコード
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

戻り値: 弧度

ソースコード

GitHubで表示

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

戻り値: 最小正角度

ソースコード
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

戻り値: 最小正角度

ソースコード

GitHubで表示

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

戻り値: 最大负角度

ソースコード
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

戻り値: 最大负角度

ソースコード

GitHubで表示

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

戻り値: 正弦值

ソースコード
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

戻り値: 正弦值

ソースコード

GitHubで表示

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

戻り値: 余弦值

ソースコード
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

戻り値: 余弦值

ソースコード

GitHubで表示

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

戻り値: 正切值

ソースコード
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

戻り値: 正切值

ソースコード

GitHubで表示

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

戻り値: 余切值

ソースコード
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

戻り値: 余切值

ソースコード

GitHubで表示

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

戻り値: 正割值

ソースコード
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

戻り値: 正割值

ソースコード

GitHubで表示

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

戻り値: 余割值

ソースコード
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

戻り値: 余割值

ソースコード

GitHubで表示

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

ソースコード
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

ソースコード
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

ソースコード
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

ソースコード
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

ソースコード

GitHubで表示

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

ソースコード

GitHubで表示

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

ソースコード

GitHubで表示

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

ソースコード

GitHubで表示

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

ソースコード

GitHubで表示

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

ソースコード
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

ソースコード

GitHubで表示

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

ソースコード
python
def __truediv__(self, other):
+    ...

def self / other

ソースコード

GitHubで表示

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
     return AnyAngle(self.radian / other, is_radian=True)

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/const.html b/ja/api/mp_math/const.html index e2ab507..829bd70 100644 --- a/ja/api/mp_math/const.html +++ b/ja/api/mp_math/const.html @@ -6,7 +6,7 @@ mbcp.mp_math.const | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.const

説明: 本模块定义了一些常用的常量

var PI = math.pi

  • 説明: 常量 π

var E = math.e

  • 説明: 自然对数的底 exp(1)

var GOLDEN_RATIO = (1 + math.sqrt(5)) / 2

  • 説明: 黄金分割比

var GAMMA = 0.5772156649015329

  • 説明: 欧拉常数

var EPSILON = 0.0001

  • 説明: 精度误差

var APPROX = 0.001

  • 説明: 约等于判定误差

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/equation.html b/ja/api/mp_math/equation.html index cdf53b1..6eb9fa7 100644 --- a/ja/api/mp_math/equation.html +++ b/ja/api/mp_math/equation.html @@ -6,19 +6,19 @@ mbcp.mp_math.equation | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+    
Skip to content

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

説明: 曲线方程。

引数:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
ソースコード

GitHubで表示

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:

戻り値: 目标点

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

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

説明: 计算曲线上的点。

引数:

  • *t:
  • 参数:

戻り値: 目标点

ソースコード

GitHubで表示

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -40,7 +40,7 @@
     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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

引数:

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

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

引数:

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

戻り値: 偏导函数

例外:

  • ValueError 无效变量类型
ソースコード

GitHubで表示

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -83,7 +83,7 @@
         return high_order_partial_derivative_func
     else:
         raise ValueError('Invalid var type')

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/function.html b/ja/api/mp_math/function.html index a312d99..9c15569 100644 --- a/ja/api/mp_math/function.html +++ b/ja/api/mp_math/function.html @@ -6,19 +6,19 @@ mbcp.mp_math.function | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

引数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

戻り値: 梯度

ソースコード
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+    
Skip to content

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

引数:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

戻り値: 梯度

ソースコード

GitHubで表示

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -37,7 +37,7 @@
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

引数:

  • func: 函数
  • *args: 参数

戻り値: 柯里化后的函数

:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
ソースコード
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
ソースコード

GitHubで表示

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -60,7 +60,7 @@
         """@litedoc-hide"""
         return func(*args, *args2)
     return curried_func

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/index.html b/ja/api/mp_math/index.html index 3ec5dbd..f8d0e80 100644 --- a/ja/api/mp_math/index.html +++ b/ja/api/mp_math/index.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

説明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/line.html b/ja/api/mp_math/line.html index f0c63cc..5a1d512 100644 --- a/ja/api/mp_math/line.html +++ b/ja/api/mp_math/line.html @@ -6,19 +6,19 @@ mbcp.mp_math.line | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

引数:

  • point: 直线上的一点
  • direction: 直线的方向向量
ソースコード
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+    
Skip to content

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

引数:

  • point: 直线上的一点
  • direction: 直线的方向向量
ソースコード

GitHubで表示

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -26,7 +26,7 @@
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -35,7 +35,7 @@
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

引数:

  • other: 另一条直线

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

引数:

  • other: 另一条直线

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -45,7 +45,7 @@
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

引数:

  • other: 平行直线或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

引数:

  • other: 平行直线或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -68,7 +68,7 @@
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

引数:

  • other: 另一条直线

戻り値: 交点

例外:

  • ValueError 直线平行
  • ValueError 直线不共面
ソースコード
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

引数:

  • other: 另一条直线

戻り値: 交点

例外:

  • ValueError 直线平行
  • ValueError 直线不共面
ソースコード

GitHubで表示

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -83,7 +83,7 @@
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

引数:

  • point: 指定点

戻り値: 垂线

ソースコード
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

引数:

  • point: 指定点

戻り値: 垂线

ソースコード

GitHubで表示

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -91,7 +91,7 @@
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

引数:

  • t: 参数t

戻り値: 点

ソースコード
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

引数:

  • t: 参数t

戻り値: 点

ソースコード

GitHubで表示

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -99,13 +99,13 @@
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

戻り値: x(t), y(t), z(t)

ソースコード
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

戻り値: x(t), y(t), z(t)

ソースコード

GitHubで表示

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似平行

ソースコード
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

引数:

  • other: 另一条直线
  • epsilon: 误差

戻り値: 是否近似平行

ソースコード

GitHubで表示

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -114,7 +114,7 @@
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

引数:

  • other: 另一条直线

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

引数:

  • other: 另一条直线

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -122,7 +122,7 @@
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

引数:

  • other: 另一条直线

戻り値: 是否共线

ソースコード
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

引数:

  • other: 另一条直线

戻り値: 是否共线

ソースコード

GitHubで表示

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -130,7 +130,7 @@
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

引数:

  • point: 点

戻り値: 是否在直线上

ソースコード
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

引数:

  • point: 点

戻り値: 是否在直线上

ソースコード

GitHubで表示

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -138,7 +138,7 @@
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

引数:

  • other: 另一条直线

戻り値: 是否共面

ソースコード
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

引数:

  • other: 另一条直线

戻り値: 是否共面

ソースコード

GitHubで表示

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -147,7 +147,7 @@
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

ソースコード
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

ソースコード

GitHubで表示

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -160,7 +160,7 @@
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

引数:

  • p1: 点1
  • p2: 点2

戻り値: 直线

ソースコード
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

引数:

  • p1: 点1
  • p2: 点2

戻り値: 直线

ソースコード

GitHubで表示

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -171,7 +171,7 @@
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

引数:

  • other: 另一条直线

戻り値: 交点

ソースコード
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

引数:

  • other: 另一条直线

戻り値: 交点

ソースコード

GitHubで表示

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -184,7 +184,7 @@
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

引数:

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

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

引数:

  • other:
ソースコード

GitHubで表示

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -196,7 +196,7 @@
 
         """
     return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/mp_math.html b/ja/api/mp_math/mp_math.html index 947f69c..2c0e8a0 100644 --- a/ja/api/mp_math/mp_math.html +++ b/ja/api/mp_math/mp_math.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

説明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ 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 8ac6e91..1866625 100644 --- a/ja/api/mp_math/mp_math_typing.html +++ b/ja/api/mp_math/mp_math_typing.html @@ -6,7 +6,7 @@ mbcp.mp_math.mp_math_typing | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.mp_math_typing

説明: 本模块用于内部类型提示

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

  • 説明: 多元函数

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/plane.html b/ja/api/mp_math/plane.html index be34062..936147b 100644 --- a/ja/api/mp_math/plane.html +++ b/ja/api/mp_math/plane.html @@ -6,19 +6,19 @@ mbcp.mp_math.plane | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

引数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
ソースコード
python
def __init__(self, a: float, b: float, c: float, d: float):
+    
Skip to content

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

引数:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
ソースコード

GitHubで表示

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -30,7 +30,7 @@
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

引数:

  • other: 另一个平面

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

引数:

  • other: 另一个平面

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -48,7 +48,7 @@
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

引数:

  • other: 另一个平面

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

引数:

  • other: 另一个平面

戻り値: 夹角弧度

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -63,7 +63,7 @@
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

引数:

  • other: 另一个平面或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

引数:

  • other: 另一个平面或点

戻り値: 距离

例外:

  • TypeError 不支持的类型
ソースコード

GitHubで表示

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -78,7 +78,7 @@
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

引数:

  • other: 另一个平面

戻り値: 两平面的交线

ソースコード
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

引数:

  • other: 另一个平面

戻り値: 两平面的交线

ソースコード

GitHubで表示

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -103,7 +103,7 @@
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

引数:

  • other: 不与平面平行或在平面上的直线

戻り値: 交点

例外:

  • ValueError 平面与直线平行或重合
ソースコード
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

引数:

  • other: 不与平面平行或在平面上的直线

戻り値: 交点

例外:

  • ValueError 平面与直线平行或重合
ソースコード

GitHubで表示

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -117,7 +117,7 @@
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

引数:

  • point: 指定点

戻り値: 所求平面

ソースコード
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

引数:

  • point: 指定点

戻り値: 所求平面

ソースコード

GitHubで表示

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -125,7 +125,7 @@
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

引数:

  • other: 另一个平面

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

引数:

  • other: 另一个平面

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -133,14 +133,14 @@
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

戻り値: 法向量

ソースコード
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

戻り値: 法向量

ソースコード

GitHubで表示

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

引数:

  • point: 平面上的一点
  • normal: 法向量

戻り値: 平面

ソースコード
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

引数:

  • point: 平面上的一点
  • normal: 法向量

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -152,7 +152,7 @@
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

引数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

戻り値: 平面

ソースコード
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

引数:

  • p1: 点1
  • p2: 点2
  • p3: 点3

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -166,7 +166,7 @@
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

引数:

  • l1: 直线1
  • l2: 直线2

戻り値: 平面

ソースコード
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

引数:

  • l1: 直线1
  • l2: 直线2

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -180,7 +180,7 @@
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

引数:

  • point: 面上一点
  • line: 面上直线,不包含点

戻り値: 平面

ソースコード
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

引数:

  • point: 面上一点
  • line: 面上直线,不包含点

戻り値: 平面

ソースコード

GitHubで表示

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -190,11 +190,11 @@
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

ソースコード
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

ソースコード

GitHubで表示

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

ソースコード
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

ソースコード

GitHubで表示

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

引数:

  • other:

戻り値: 不平行平面的交线,平面平行返回None

ソースコード
python
def __and__(self, other):
+    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

引数:

  • other:

戻り値: 不平行平面的交线,平面平行返回None

ソースコード

GitHubで表示

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -211,10 +211,10 @@
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

ソースコード
python
def __rand__(self, other: 'Line3') -> 'Point3':
+        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

ソースコード

GitHubで表示

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

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

ソースコード

GitHubで表示

python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/point.html b/ja/api/mp_math/point.html index 592024f..a5f92b3 100644 --- a/ja/api/mp_math/point.html +++ b/ja/api/mp_math/point.html @@ -6,19 +6,19 @@ mbcp.mp_math.point | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

引数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
ソースコード
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

引数:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
ソースコード

GitHubで表示

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -38,11 +38,11 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

ソースコード
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: P + V -> P P + P -> P

引数:

  • other:
ソースコード
python
def __add__(self, other):
+    ...

def self + other

説明: P + V -> P P + P -> P

引数:

  • other:
ソースコード

GitHubで表示

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -50,14 +50,14 @@
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

引数:

  • other:
ソースコード
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

引数:

  • other:
ソースコード

GitHubで表示

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

引数:

  • other:
ソースコード
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

引数:

  • other:
ソースコード

GitHubで表示

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -69,7 +69,7 @@
         """
     from .vector import Vector3
     return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/segment.html b/ja/api/mp_math/segment.html index 8985d85..010147a 100644 --- a/ja/api/mp_math/segment.html +++ b/ja/api/mp_math/segment.html @@ -6,19 +6,19 @@ mbcp.mp_math.segment | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

ソースコード
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+    
Skip to content

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

ソースコード

GitHubで表示

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -32,7 +32,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)

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/utils.html b/ja/api/mp_math/utils.html index 08fef2e..9ccca3d 100644 --- a/ja/api/mp_math/utils.html +++ b/ja/api/mp_math/utils.html @@ -6,19 +6,19 @@ mbcp.mp_math.utils | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

引数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

戻り値: 限制后的值

ソースコード
python
def clamp(x: float, min_: float, max_: float) -> float:
+    
Skip to content

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

引数:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

戻り値: 限制后的值

ソースコード

GitHubで表示

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -29,8 +29,8 @@
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

ソースコード
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

ソースコード
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

ソースコード

GitHubで表示

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

ソースコード

GitHubで表示

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -40,9 +40,9 @@
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

ソースコード
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

引数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

ソースコード

GitHubで表示

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

def __ne__(self, other)

ソースコード

GitHubで表示

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

引数:

  • x: 数1
  • y: 数2
  • epsilon: 误差

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -52,7 +52,7 @@
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード

GitHubで表示

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -65,7 +65,7 @@
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

引数:

  • x: 数
  • only_neg: 是否只返回负数的符号

戻り値: 符号 + - ""

ソースコード

GitHubで表示

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -82,7 +82,7 @@
         return f'-{abs(x)}'
     else:
         return ''

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/mp_math/vector.html b/ja/api/mp_math/vector.html index bd45d5f..5f2dc29 100644 --- a/ja/api/mp_math/vector.html +++ b/ja/api/mp_math/vector.html @@ -6,19 +6,19 @@ mbcp.mp_math.vector | MBCP ドキュメント - + - + -
Skip to content

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

引数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
ソースコード
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

引数:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
ソースコード

GitHubで表示

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

引数:

  • other:
  • epsilon:

戻り値: 是否近似相等

ソースコード

GitHubで表示

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -38,7 +38,7 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

引数:

  • other: 另一个向量

戻り値: 夹角

ソースコード
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

引数:

  • other: 另一个向量

戻り値: 夹角

ソースコード

GitHubで表示

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -46,7 +46,7 @@
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

引数:

  • other:

戻り値: 行列式的结果

ソースコード
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

引数:

  • other:

戻り値: 行列式的结果

ソースコード

GitHubで表示

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -66,7 +66,7 @@
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

引数:

  • other: 另一个向量
  • epsilon: 允许的误差

戻り値: 是否近似平行

ソースコード
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

引数:

  • other: 另一个向量
  • epsilon: 允许的误差

戻り値: 是否近似平行

ソースコード

GitHubで表示

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -75,7 +75,7 @@
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

引数:

  • other: 另一个向量

戻り値: 是否平行

ソースコード
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

引数:

  • other: 另一个向量

戻り値: 是否平行

ソースコード

GitHubで表示

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -83,7 +83,7 @@
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

ソースコード
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

ソースコード

GitHubで表示

python
def normalize(self):
     """
         将向量归一化。
 
@@ -92,32 +92,32 @@
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

ソースコード
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

ソースコード

GitHubで表示

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

戻り値: 模

ソースコード
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

戻り値: 模

ソースコード

GitHubで表示

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

戻り値: 单位向量

ソースコード
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

戻り値: 单位向量

ソースコード

GitHubで表示

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

ソースコード
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

ソースコード
python
@overload
+    return self / self.length

def __abs__(self)

ソースコード

GitHubで表示

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: V + P -> P

V + V -> V

引数:

  • other:
ソースコード
python
def __add__(self, other):
+    ...

def self + other

説明: V + P -> P

V + V -> V

引数:

  • other:
ソースコード

GitHubで表示

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -132,7 +132,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

引数:

  • other:

戻り値: 是否相等

ソースコード
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

引数:

  • other:

戻り値: 是否相等

ソースコード

GitHubで表示

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -140,7 +140,7 @@
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

ソースコード
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

ソースコード

GitHubで表示

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -148,11 +148,11 @@
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

ソースコード
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

ソースコード
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

ソースコード

GitHubで表示

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

説明: V - P -> P

V - V -> V

引数:

  • other:
ソースコード
python
def __sub__(self, other):
+    ...

def self - other

説明: V - P -> P

V - V -> V

引数:

  • other:
ソースコード

GitHubで表示

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -166,7 +166,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

引数:

  • other:
ソースコード
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

引数:

  • other:
ソースコード

GitHubで表示

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -177,11 +177,11 @@
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

ソースコード
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

ソースコード

GitHubで表示

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

ソースコード
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

ソースコード

GitHubで表示

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

引数:

  • other:
ソースコード
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

引数:

  • other:
ソースコード

GitHubで表示

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -194,18 +194,18 @@
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

ソースコード
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

引数:

  • other:
ソースコード
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

ソースコード

GitHubで表示

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

引数:

  • other:
ソースコード

GitHubで表示

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

ソースコード
python
def __neg__(self):
+    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

ソースコード

GitHubで表示

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

def - self

ソースコード

GitHubで表示

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

var zero_vector3 = Vector3(0, 0, 0)

  • タイプ: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • タイプ: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • タイプ: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • タイプ: Vector3

  • 説明: z轴单位向量

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/particle/index.html b/ja/api/particle/index.html index cf96130..9cc9647 100644 --- a/ja/api/particle/index.html +++ b/ja/api/particle/index.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP ドキュメント - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/ja/api/particle/particle.html b/ja/api/particle/particle.html index 3ba371c..27deaf1 100644 --- a/ja/api/particle/particle.html +++ b/ja/api/particle/particle.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP ドキュメント - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/ja/api/presets/index.html b/ja/api/presets/index.html index 085db8c..1ed2b18 100644 --- a/ja/api/presets/index.html +++ b/ja/api/presets/index.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

説明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/presets/model/index.html b/ja/api/presets/model/index.html index 5a75a2c..2e202b2 100644 --- a/ja/api/presets/model/index.html +++ b/ja/api/presets/model/index.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP ドキュメント - + - + -
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード
python
@staticmethod
+    
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード

GitHubで表示

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/presets/model/model.html b/ja/api/presets/model/model.html index 6ae68eb..04918b0 100644 --- a/ja/api/presets/model/model.html +++ b/ja/api/presets/model/model.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP ドキュメント - + - + -
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード
python
@staticmethod
+    
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

引数:

  • radius:
  • density:

戻り値: List[Point3]: 球体上的点集。

ソースコード

GitHubで表示

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/api/presets/presets.html b/ja/api/presets/presets.html index ac5217d..bd4fda7 100644 --- a/ja/api/presets/presets.html +++ b/ja/api/presets/presets.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

説明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/guide/index.html b/ja/guide/index.html index 2d72ff6..14dc984 100644 --- a/ja/guide/index.html +++ b/ja/guide/index.html @@ -6,7 +6,7 @@ 开始不了一点 | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/index.html b/ja/index.html index 94f2785..7fa8fe3 100644 --- a/ja/index.html +++ b/ja/index.html @@ -6,7 +6,7 @@ MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

MBCP

More basic change particle

ジオメトリ演算とパーティクル作成のためのライブラリ

MBCP logo

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/ja/refer/index.html b/ja/refer/index.html index 6a38d95..47d2eac 100644 --- a/ja/refer/index.html +++ b/ja/refer/index.html @@ -6,7 +6,7 @@ Reference | MBCP ドキュメント - + @@ -19,7 +19,7 @@
Skip to content

Reference

Help us to improve the documentation

VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス

- + \ No newline at end of file diff --git a/refer/function/curry.html b/refer/function/curry.html index 4aeb7fe..d23a75d 100644 --- a/refer/function/curry.html +++ b/refer/function/curry.html @@ -6,7 +6,7 @@ 柯里化 | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/refer/function/function.html b/refer/function/function.html index be169a2..399171f 100644 --- a/refer/function/function.html +++ b/refer/function/function.html @@ -6,7 +6,7 @@ 函数 | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/refer/index.html b/refer/index.html index 396b6e9..c5d126f 100644 --- a/refer/index.html +++ b/refer/index.html @@ -6,7 +6,7 @@ 参考 | MBCP 文档 - + @@ -19,7 +19,7 @@
Skip to content

Reference

Help us to improve the documentation

文档由 VitePress 构建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/api.html b/zht/api/api.html index 021ef5e..68325b2 100644 --- a/zht/api/api.html +++ b/zht/api/api.html @@ -6,7 +6,7 @@ mbcp | MBCP 文檔 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/zht/api/index.html b/zht/api/index.html index 1e948f2..85b4064 100644 --- a/zht/api/index.html +++ b/zht/api/index.html @@ -6,7 +6,7 @@ mbcp | MBCP 文檔 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/zht/api/mp_math/angle.html b/zht/api/mp_math/angle.html index 1ac4f28..60f42f3 100644 --- a/zht/api/mp_math/angle.html +++ b/zht/api/mp_math/angle.html @@ -6,19 +6,19 @@ mbcp.mp_math.angle | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

變數説明:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源碼
python
def __init__(self, value: float, is_radian: bool=False):
+    
Skip to content

mbcp.mp_math.angle

説明: 本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

def __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

變數説明:

  • value: 角度或弧度值
  • is_radian: 是否为弧度,默认为否
源碼

在GitHub上查看

python
def __init__(self, value: float, is_radian: bool=False):
     """
         任意角度。
         Args:
@@ -28,96 +28,96 @@
     if is_radian:
         self.radian = value
     else:
-        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

返回: 余角

源碼
python
@property
+        self.radian = value * PI / 180

@property

def complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

返回: 余角

源碼

在GitHub上查看

python
@property
 def complementary(self) -> 'AnyAngle':
     """
         余角:两角的和为90°。
         Returns:
             余角
         """
-    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

返回: 补角

源碼
python
@property
+    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

def supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

返回: 补角

源碼

在GitHub上查看

python
@property
 def supplementary(self) -> 'AnyAngle':
     """
         补角:两角的和为180°。
         Returns:
             补角
         """
-    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

返回: 弧度

源碼
python
@property
+    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

def degree(self) -> float

説明: 角度。

返回: 弧度

源碼

在GitHub上查看

python
@property
 def degree(self) -> float:
     """
         角度。
         Returns:
             弧度
         """
-    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

返回: 最小正角度

源碼
python
@property
+    return self.radian * 180 / PI

@property

def minimum_positive(self) -> AnyAngle

説明: 最小正角。

返回: 最小正角度

源碼

在GitHub上查看

python
@property
 def minimum_positive(self) -> 'AnyAngle':
     """
         最小正角。
         Returns:
             最小正角度
         """
-    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

返回: 最大负角度

源碼
python
@property
+    return AnyAngle(self.radian % (2 * PI))

@property

def maximum_negative(self) -> AnyAngle

説明: 最大负角。

返回: 最大负角度

源碼

在GitHub上查看

python
@property
 def maximum_negative(self) -> 'AnyAngle':
     """
         最大负角。
         Returns:
             最大负角度
         """
-    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

返回: 正弦值

源碼
python
@property
+    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

def sin(self) -> float

説明: 正弦值。

返回: 正弦值

源碼

在GitHub上查看

python
@property
 def sin(self) -> float:
     """
         正弦值。
         Returns:
             正弦值
         """
-    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

返回: 余弦值

源碼
python
@property
+    return math.sin(self.radian)

@property

def cos(self) -> float

説明: 余弦值。

返回: 余弦值

源碼

在GitHub上查看

python
@property
 def cos(self) -> float:
     """
         余弦值。
         Returns:
             余弦值
         """
-    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

返回: 正切值

源碼
python
@property
+    return math.cos(self.radian)

@property

def tan(self) -> float

説明: 正切值。

返回: 正切值

源碼

在GitHub上查看

python
@property
 def tan(self) -> float:
     """
         正切值。
         Returns:
             正切值
         """
-    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

返回: 余切值

源碼
python
@property
+    return math.tan(self.radian)

@property

def cot(self) -> float

説明: 余切值。

返回: 余切值

源碼

在GitHub上查看

python
@property
 def cot(self) -> float:
     """
         余切值。
         Returns:
             余切值
         """
-    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

返回: 正割值

源碼
python
@property
+    return 1 / math.tan(self.radian)

@property

def sec(self) -> float

説明: 正割值。

返回: 正割值

源碼

在GitHub上查看

python
@property
 def sec(self) -> float:
     """
         正割值。
         Returns:
             正割值
         """
-    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

返回: 余割值

源碼
python
@property
+    return 1 / math.cos(self.radian)

@property

def csc(self) -> float

説明: 余割值。

返回: 余割值

源碼

在GitHub上查看

python
@property
 def csc(self) -> float:
     """
         余割值。
         Returns:
             余割值
         """
-    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源碼
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

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

def self - other: AnyAngle => AnyAngle

源碼
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
-    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源碼
python
def __mul__(self, other: float) -> 'AnyAngle':
-    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源碼
python
@overload
+    return 1 / math.sin(self.radian)

def self + other: AnyAngle => AnyAngle

源碼

在GitHub上查看

python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian + other.radian, is_radian=True)

def __eq__(self, other)

源碼

在GitHub上查看

python
def __eq__(self, other):
+    return approx(self.radian, other.radian)

def self - other: AnyAngle => AnyAngle

源碼

在GitHub上查看

python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':
+    return AnyAngle(self.radian - other.radian, is_radian=True)

def self * other: float => AnyAngle

源碼

在GitHub上查看

python
def __mul__(self, other: float) -> 'AnyAngle':
+    return AnyAngle(self.radian * other, is_radian=True)

@overload

def self / other: float => AnyAngle

源碼

在GitHub上查看

python
@overload
 def __truediv__(self, other: float) -> 'AnyAngle':
-    ...

@overload

def self / other: AnyAngle => float

源碼
python
@overload
+    ...

@overload

def self / other: AnyAngle => float

源碼

在GitHub上查看

python
@overload
 def __truediv__(self, other: 'AnyAngle') -> float:
-    ...

def self / other

源碼
python
def __truediv__(self, other):
+    ...

def self / other

源碼

在GitHub上查看

python
def __truediv__(self, other):
     if isinstance(other, AnyAngle):
         return self.radian / other.radian
     return AnyAngle(self.radian / other, is_radian=True)

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/const.html b/zht/api/mp_math/const.html index 4fd338f..1101f6b 100644 --- a/zht/api/mp_math/const.html +++ b/zht/api/mp_math/const.html @@ -6,7 +6,7 @@ mbcp.mp_math.const | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.const

説明: 本模块定义了一些常用的常量

var PI = math.pi

  • 説明: 常量 π

var E = math.e

  • 説明: 自然对数的底 exp(1)

var GOLDEN_RATIO = (1 + math.sqrt(5)) / 2

  • 説明: 黄金分割比

var GAMMA = 0.5772156649015329

  • 説明: 欧拉常数

var EPSILON = 0.0001

  • 説明: 精度误差

var APPROX = 0.001

  • 説明: 约等于判定误差

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/equation.html b/zht/api/mp_math/equation.html index 7875d12..f7fb562 100644 --- a/zht/api/mp_math/equation.html +++ b/zht/api/mp_math/equation.html @@ -6,19 +6,19 @@ mbcp.mp_math.equation | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

def __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):
+    
Skip to content

mbcp.mp_math.equation

説明: 本模块定义了方程相关的类和函数以及一些常用的数学函数

class CurveEquation

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

説明: 曲线方程。

變數説明:

  • x_func: x函数
  • y_func: y函数
  • z_func: z函数
源碼

在GitHub上查看

python
def __init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):
     """
         曲线方程。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x_func = x_func
     self.y_func = y_func
-    self.z_func = z_func

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

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:

返回: 目标点

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

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

説明: 计算曲线上的点。

變數説明:

  • *t:
  • 参数:

返回: 目标点

源碼

在GitHub上查看

python
def __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]:
     """
         计算曲线上的点。
         Args:
@@ -40,7 +40,7 @@
     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))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

變數説明:

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

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼
python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
+        return tuple([Point3(x, y, z) for x, y, z in zip(self.x_func(t), self.y_func(t), self.z_func(t))])

def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc

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

WARNING

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

變數説明:

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

返回: 偏导函数

抛出:

  • ValueError 无效变量类型
源碼

在GitHub上查看

python
def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number=EPSILON) -> MultiVarsFunc:
     """
     求N元函数一阶偏导函数。这玩意不太稳定,慎用。
     > [!warning]
@@ -83,7 +83,7 @@
         return high_order_partial_derivative_func
     else:
         raise ValueError('Invalid var type')

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/function.html b/zht/api/mp_math/function.html index d9c3904..7d708db 100644 --- a/zht/api/mp_math/function.html +++ b/zht/api/mp_math/function.html @@ -6,19 +6,19 @@ mbcp.mp_math.function | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

變數説明:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源碼
python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
+    
Skip to content

mbcp.mp_math.function

説明: AAA

def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float = EPSILON) -> Vector3

説明: 计算三元函数在某点的梯度向量。

TIP

已知一个函数f(x,y,z),则其在点(x0,y0,z0)处的梯度向量为: f(x0,y0,z0)=(fx,fy,fz)

變數説明:

  • func: 三元函数
  • p: 点
  • epsilon: 偏移量

返回: 梯度

源碼

在GitHub上查看

python
def cal_gradient_3vf(func: ThreeSingleVarsFunc, p: Point3, epsilon: float=EPSILON) -> Vector3:
     """
     计算三元函数在某点的梯度向量。
     > [!tip]
@@ -37,7 +37,7 @@
     return Vector3(dx, dy, dz)

def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc

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

TIP

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

變數説明:

  • func: 函数
  • *args: 参数

返回: 柯里化后的函数

範例:

python
def add(a: int, b: int, c: int) -> int:
     return a + b + c
 add_curried = curry(add, 1, 2)
-add_curried(3)  # 6
源碼
python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
+add_curried(3)  # 6
源碼

在GitHub上查看

python
def curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc:
     """
     对多参数函数进行柯里化。
     > [!tip]
@@ -60,7 +60,7 @@
         """@litedoc-hide"""
         return func(*args, *args2)
     return curried_func

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/index.html b/zht/api/mp_math/index.html index 64bdf72..906091d 100644 --- a/zht/api/mp_math/index.html +++ b/zht/api/mp_math/index.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

説明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/line.html b/zht/api/mp_math/line.html index 4bc4acc..1622c8b 100644 --- a/zht/api/mp_math/line.html +++ b/zht/api/mp_math/line.html @@ -6,19 +6,19 @@ mbcp.mp_math.line | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

變數説明:

  • point: 直线上的一点
  • direction: 直线的方向向量
源碼
python
def __init__(self, point: 'Point3', direction: 'Vector3'):
+    
Skip to content

mbcp.mp_math.line

説明: 本模块定义了三维空间中的直线类

class Line3

def __init__(self, point: Point3, direction: Vector3)

説明: 三维空间中的直线。由一个点和一个方向向量确定。

變數説明:

  • point: 直线上的一点
  • direction: 直线的方向向量
源碼

在GitHub上查看

python
def __init__(self, point: 'Point3', direction: 'Vector3'):
     """
         三维空间中的直线。由一个点和一个方向向量确定。
         Args:
@@ -26,7 +26,7 @@
             direction: 直线的方向向量
         """
     self.point = point
-    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源碼
python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
+    self.direction = direction

def approx(self, other: Line3, epsilon: float = APPROX) -> bool

説明: 判断两条直线是否近似相等。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Line3', epsilon: float=APPROX) -> bool:
     """
         判断两条直线是否近似相等。
         Args:
@@ -35,7 +35,7 @@
         Returns:
             是否近似相等
         """
-    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

變數説明:

  • other: 另一条直线

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
+    return self.is_approx_parallel(other, epsilon) and (self.point - other.point).is_approx_parallel(self.direction, epsilon)

def cal_angle(self, other: Line3) -> AnyAngle

説明: 计算直线和直线之间的夹角。

變數説明:

  • other: 另一条直线

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_angle(self, other: 'Line3') -> 'AnyAngle':
     """
         计算直线和直线之间的夹角。
         Args:
@@ -45,7 +45,7 @@
         Raises:
             TypeError: 不支持的类型
         """
-    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

變數説明:

  • other: 平行直线或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_distance(self, other: 'Line3 | Point3') -> float:
+    return self.direction.cal_angle(other.direction)

def cal_distance(self, other: Line3 | Point3) -> float

説明: 计算直线和直线或点之间的距离。

變數説明:

  • other: 平行直线或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_distance(self, other: 'Line3 | Point3') -> float:
     """
         计算直线和直线或点之间的距离。
         Args:
@@ -68,7 +68,7 @@
     elif isinstance(other, Point3):
         return (other - self.point).cross(self.direction).length / self.direction.length
     else:
-        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

變數説明:

  • other: 另一条直线

返回: 交点

抛出:

  • ValueError 直线平行
  • ValueError 直线不共面
源碼
python
def cal_intersection(self, other: 'Line3') -> 'Point3':
+        raise TypeError('Unsupported type.')

def cal_intersection(self, other: Line3) -> Point3

説明: 计算两条直线的交点。

變數説明:

  • other: 另一条直线

返回: 交点

抛出:

  • ValueError 直线平行
  • ValueError 直线不共面
源碼

在GitHub上查看

python
def cal_intersection(self, other: 'Line3') -> 'Point3':
     """
         计算两条直线的交点。
         Args:
@@ -83,7 +83,7 @@
         raise ValueError('Lines are parallel and do not intersect.')
     if not self.is_coplanar(other):
         raise ValueError('Lines are not coplanar and do not intersect.')
-    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

變數説明:

  • point: 指定点

返回: 垂线

源碼
python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
+    return self.point + self.direction.cross(other.direction) @ other.direction.cross(self.point - other.point) / self.direction.cross(other.direction).length ** 2 * self.direction

def cal_perpendicular(self, point: Point3) -> Line3

説明: 计算直线经过指定点p的垂线。

變數説明:

  • point: 指定点

返回: 垂线

源碼

在GitHub上查看

python
def cal_perpendicular(self, point: 'Point3') -> 'Line3':
     """
         计算直线经过指定点p的垂线。
         Args:
@@ -91,7 +91,7 @@
         Returns:
             垂线
         """
-    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

變數説明:

  • t: 参数t

返回: 点

源碼
python
def get_point(self, t: RealNumber) -> 'Point3':
+    return Line3(point, self.direction.cross(point - self.point))

def get_point(self, t: RealNumber) -> Point3

説明: 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。

變數説明:

  • t: 参数t

返回: 点

源碼

在GitHub上查看

python
def get_point(self, t: RealNumber) -> 'Point3':
     """
         获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。
         Args:
@@ -99,13 +99,13 @@
         Returns:
 
         """
-    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源碼
python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
+    return self.point + t * self.direction

def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]

説明: 获取直线的参数方程。

返回: x(t), y(t), z(t)

源碼

在GitHub上查看

python
def get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:
     """
         获取直线的参数方程。
         Returns:
             x(t), y(t), z(t)
         """
-    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源碼
python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
+    return (lambda t: self.point.x + self.direction.x * t, lambda t: self.point.y + self.direction.y * t, lambda t: self.point.z + self.direction.z * t)

def is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool

説明: 判断两条直线是否近似平行。

變數説明:

  • other: 另一条直线
  • epsilon: 误差

返回: 是否近似平行

源碼

在GitHub上查看

python
def is_approx_parallel(self, other: 'Line3', epsilon: float=1e-06) -> bool:
     """
         判断两条直线是否近似平行。
         Args:
@@ -114,7 +114,7 @@
         Returns:
             是否近似平行
         """
-    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

變數説明:

  • other: 另一条直线

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Line3') -> bool:
+    return self.direction.is_approx_parallel(other.direction, epsilon)

def is_parallel(self, other: Line3) -> bool

説明: 判断两条直线是否平行。

變數説明:

  • other: 另一条直线

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Line3') -> bool:
     """
         判断两条直线是否平行。
         Args:
@@ -122,7 +122,7 @@
         Returns:
             是否平行
         """
-    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

變數説明:

  • other: 另一条直线

返回: 是否共线

源碼
python
def is_collinear(self, other: 'Line3') -> bool:
+    return self.direction.is_parallel(other.direction)

def is_collinear(self, other: Line3) -> bool

説明: 判断两条直线是否共线。

變數説明:

  • other: 另一条直线

返回: 是否共线

源碼

在GitHub上查看

python
def is_collinear(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共线。
         Args:
@@ -130,7 +130,7 @@
         Returns:
             是否共线
         """
-    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

變數説明:

  • point: 点

返回: 是否在直线上

源碼
python
def is_point_on(self, point: 'Point3') -> bool:
+    return self.is_parallel(other) and (self.point - other.point).is_parallel(self.direction)

def is_point_on(self, point: Point3) -> bool

説明: 判断点是否在直线上。

變數説明:

  • point: 点

返回: 是否在直线上

源碼

在GitHub上查看

python
def is_point_on(self, point: 'Point3') -> bool:
     """
         判断点是否在直线上。
         Args:
@@ -138,7 +138,7 @@
         Returns:
             是否在直线上
         """
-    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

變數説明:

  • other: 另一条直线

返回: 是否共面

源碼
python
def is_coplanar(self, other: 'Line3') -> bool:
+    return (point - self.point).is_parallel(self.direction)

def is_coplanar(self, other: Line3) -> bool

説明: 判断两条直线是否共面。 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。

變數説明:

  • other: 另一条直线

返回: 是否共面

源碼

在GitHub上查看

python
def is_coplanar(self, other: 'Line3') -> bool:
     """
         判断两条直线是否共面。
         充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。
@@ -147,7 +147,7 @@
         Returns:
             是否共面
         """
-    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源碼
python
def simplify(self):
+    return self.direction.cross(other.direction) @ (self.point - other.point) == 0

def simplify(self)

説明: 简化直线方程,等价相等。 自体简化,不返回值。

按照可行性一次对x y z 化 0 处理,并对向量单位化

源碼

在GitHub上查看

python
def simplify(self):
     """
         简化直线方程,等价相等。
         自体简化,不返回值。
@@ -160,7 +160,7 @@
     if self.direction.y == 0:
         self.point.y = 0
     if self.direction.z == 0:
-        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

變數説明:

  • p1: 点1
  • p2: 点2

返回: 直线

源碼
python
@classmethod
+        self.point.z = 0

@classmethod

def from_two_points(cls, p1: Point3, p2: Point3) -> Line3

説明: 工厂函数 由两点构造直线。

變數説明:

  • p1: 点1
  • p2: 点2

返回: 直线

源碼

在GitHub上查看

python
@classmethod
 def from_two_points(cls, p1: 'Point3', p2: 'Point3') -> 'Line3':
     """
         工厂函数 由两点构造直线。
@@ -171,7 +171,7 @@
             直线
         """
     direction = p2 - p1
-    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

變數説明:

  • other: 另一条直线

返回: 交点

源碼
python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
+    return cls(p1, direction)

def __and__(self, other: Line3) -> Line3 | Point3 | None

説明: 计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。

變數説明:

  • other: 另一条直线

返回: 交点

源碼

在GitHub上查看

python
def __and__(self, other: 'Line3') -> 'Line3 | Point3 | None':
     """
         计算两条直线点集合的交集。重合线返回自身,平行线返回None,交线返回交点。
         Args:
@@ -184,7 +184,7 @@
     elif self.is_parallel(other) or not self.is_coplanar(other):
         return None
     else:
-        return self.cal_intersection(other)

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

變數説明:

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

def __eq__(self, other) -> bool

説明: 判断两条直线是否等价。

v1 // v2 ∧ (p1 - p2) // v1

變數説明:

  • other:
源碼

在GitHub上查看

python
def __eq__(self, other) -> bool:
     """
         判断两条直线是否等价。
 
@@ -196,7 +196,7 @@
 
         """
     return self.direction.is_parallel(other.direction) and (self.point - other.point).is_parallel(self.direction)

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/mp_math.html b/zht/api/mp_math/mp_math.html index d85eb54..59d4898 100644 --- a/zht/api/mp_math/mp_math.html +++ b/zht/api/mp_math/mp_math.html @@ -6,7 +6,7 @@ mbcp.mp_math | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math

説明: 本包定义了一些常用的导入,可直接从mbcp.mp_math导入使用 导入的类有:

  • AnyAngle:任意角
  • CurveEquation:曲线方程
  • Line3:三维直线
  • Plane3:三维平面
  • Point3:三维点
  • Segment3:三维线段
  • Vector3:三维向量

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ 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 899e9b1..efba4cb 100644 --- a/zht/api/mp_math/mp_math_typing.html +++ b/zht/api/mp_math/mp_math_typing.html @@ -6,7 +6,7 @@ mbcp.mp_math.mp_math_typing | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.mp_math.mp_math_typing

説明: 本模块用于内部类型提示

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

  • 説明: 多元函数

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/plane.html b/zht/api/mp_math/plane.html index f9ba4e9..610beb9 100644 --- a/zht/api/mp_math/plane.html +++ b/zht/api/mp_math/plane.html @@ -6,19 +6,19 @@ mbcp.mp_math.plane | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

變數説明:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源碼
python
def __init__(self, a: float, b: float, c: float, d: float):
+    
Skip to content

mbcp.mp_math.plane

説明: 本模块定义了三维空间中的平面类

class Plane3

def __init__(self, a: float, b: float, c: float, d: float)

説明: 平面方程:ax + by + cz + d = 0

變數説明:

  • a: x系数
  • b: y系数
  • c: z系数
  • d: 常数项
源碼

在GitHub上查看

python
def __init__(self, a: float, b: float, c: float, d: float):
     """
         平面方程:ax + by + cz + d = 0
         Args:
@@ -30,7 +30,7 @@
     self.a = a
     self.b = b
     self.c = c
-    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

變數説明:

  • other: 另一个平面

返回: 是否近似相等

源碼
python
def approx(self, other: 'Plane3') -> bool:
+    self.d = d

def approx(self, other: Plane3) -> bool

説明: 判断两个平面是否近似相等。

變數説明:

  • other: 另一个平面

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否近似相等。
         Args:
@@ -48,7 +48,7 @@
         k = other.c / self.c
         return approx(other.a, self.a * k) and approx(other.b, self.b * k) and approx(other.d, self.d * k)
     else:
-        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

變數説明:

  • other: 另一个平面

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
+        return False

def cal_angle(self, other: Line3 | Plane3) -> AnyAngle

説明: 计算平面与平面之间的夹角。

變數説明:

  • other: 另一个平面

返回: 夹角弧度

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_angle(self, other: 'Line3 | Plane3') -> 'AnyAngle':
     """
         计算平面与平面之间的夹角。
         Args:
@@ -63,7 +63,7 @@
     elif isinstance(other, Plane3):
         return AnyAngle(math.acos(self.normal @ other.normal / (self.normal.length * other.normal.length)), is_radian=True)
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

變數説明:

  • other: 另一个平面或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼
python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_distance(self, other: Plane3 | Point3) -> float

説明: 计算平面与平面或点之间的距离。

變數説明:

  • other: 另一个平面或点

返回: 距离

抛出:

  • TypeError 不支持的类型
源碼

在GitHub上查看

python
def cal_distance(self, other: 'Plane3 | Point3') -> float:
     """
         计算平面与平面或点之间的距离。
         Args:
@@ -78,7 +78,7 @@
     elif isinstance(other, Point3):
         return abs(self.a * other.x + self.b * other.y + self.c * other.z + self.d) / (self.a ** 2 + self.b ** 2 + self.c ** 2) ** 0.5
     else:
-        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

變數説明:

  • other: 另一个平面

返回: 两平面的交线

源碼
python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
+        raise TypeError(f'Unsupported type: {type(other)}')

def cal_intersection_line3(self, other: Plane3) -> Line3

説明: 计算两平面的交线。

變數説明:

  • other: 另一个平面

返回: 两平面的交线

源碼

在GitHub上查看

python
def cal_intersection_line3(self, other: 'Plane3') -> 'Line3':
     """
         计算两平面的交线。
         Args:
@@ -103,7 +103,7 @@
         A = np.array([[self.a, self.b], [other.a, other.b]])
         B = np.array([-self.d, -other.d])
         x, y = np.linalg.solve(A, B)
-    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

變數説明:

  • other: 不与平面平行或在平面上的直线

返回: 交点

抛出:

  • ValueError 平面与直线平行或重合
源碼
python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
+    return Line3(Point3(x, y, z), direction)

def cal_intersection_point3(self, other: Line3) -> Point3

説明: 计算平面与直线的交点。

變數説明:

  • other: 不与平面平行或在平面上的直线

返回: 交点

抛出:

  • ValueError 平面与直线平行或重合
源碼

在GitHub上查看

python
def cal_intersection_point3(self, other: 'Line3') -> 'Point3':
     """
         计算平面与直线的交点。
         Args:
@@ -117,7 +117,7 @@
         raise ValueError('The plane and the line are parallel or coincident.')
     x, y, z = other.get_parametric_equations()
     t = -(self.a * other.point.x + self.b * other.point.y + self.c * other.point.z + self.d) / (self.a * other.direction.x + self.b * other.direction.y + self.c * other.direction.z)
-    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

變數説明:

  • point: 指定点

返回: 所求平面

源碼
python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
+    return Point3(x(t), y(t), z(t))

def cal_parallel_plane3(self, point: Point3) -> Plane3

説明: 计算平行于该平面且过指定点的平面。

變數説明:

  • point: 指定点

返回: 所求平面

源碼

在GitHub上查看

python
def cal_parallel_plane3(self, point: 'Point3') -> 'Plane3':
     """
         计算平行于该平面且过指定点的平面。
         Args:
@@ -125,7 +125,7 @@
         Returns:
             所求平面
         """
-    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

變數説明:

  • other: 另一个平面

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Plane3') -> bool:
+    return Plane3.from_point_and_normal(point, self.normal)

def is_parallel(self, other: Plane3) -> bool

説明: 判断两个平面是否平行。

變數説明:

  • other: 另一个平面

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Plane3') -> bool:
     """
         判断两个平面是否平行。
         Args:
@@ -133,14 +133,14 @@
         Returns:
             是否平行
         """
-    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

返回: 法向量

源碼
python
@property
+    return self.normal.is_parallel(other.normal)

@property

def normal(self) -> Vector3

説明: 平面的法向量。

返回: 法向量

源碼

在GitHub上查看

python
@property
 def normal(self) -> 'Vector3':
     """
         平面的法向量。
         Returns:
             法向量
         """
-    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

變數説明:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源碼
python
@classmethod
+    return Vector3(self.a, self.b, self.c)

@classmethod

def from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3

説明: 工厂函数 由点和法向量构造平面(点法式构造)。

變數説明:

  • point: 平面上的一点
  • normal: 法向量

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_point_and_normal(cls, point: 'Point3', normal: 'Vector3') -> 'Plane3':
     """
         工厂函数 由点和法向量构造平面(点法式构造)。
@@ -152,7 +152,7 @@
         """
     a, b, c = (normal.x, normal.y, normal.z)
     d = -a * point.x - b * point.y - c * point.z
-    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

變數説明:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源碼
python
@classmethod
+    return cls(a, b, c, d)

@classmethod

def from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3

説明: 工厂函数 由三点构造平面。

變數説明:

  • p1: 点1
  • p2: 点2
  • p3: 点3

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_three_points(cls, p1: 'Point3', p2: 'Point3', p3: 'Point3') -> 'Plane3':
     """
         工厂函数 由三点构造平面。
@@ -166,7 +166,7 @@
     v1 = p2 - p1
     v2 = p3 - p1
     normal = v1.cross(v2)
-    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

變數説明:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源碼
python
@classmethod
+    return cls.from_point_and_normal(p1, normal)

@classmethod

def from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3

説明: 工厂函数 由两直线构造平面。

變數説明:

  • l1: 直线1
  • l2: 直线2

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_two_lines(cls, l1: 'Line3', l2: 'Line3') -> 'Plane3':
     """
         工厂函数 由两直线构造平面。
@@ -180,7 +180,7 @@
     v2 = l2.point - l1.point
     if v2 == zero_vector3:
         v2 = l2.get_point(1) - l1.point
-    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

變數説明:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源碼
python
@classmethod
+    return cls.from_point_and_normal(l1.point, v1.cross(v2))

@classmethod

def from_point_and_line(cls, point: Point3, line: Line3) -> Plane3

説明: 工厂函数 由点和直线构造平面。

變數説明:

  • point: 面上一点
  • line: 面上直线,不包含点

返回: 平面

源碼

在GitHub上查看

python
@classmethod
 def from_point_and_line(cls, point: 'Point3', line: 'Line3') -> 'Plane3':
     """
         工厂函数 由点和直线构造平面。
@@ -190,11 +190,11 @@
         Returns:
             平面
         """
-    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源碼
python
@overload
+    return cls.from_point_and_normal(point, line.direction)

@overload

def __and__(self, other: Line3) -> Point3 | None

源碼

在GitHub上查看

python
@overload
 def __and__(self, other: 'Line3') -> 'Point3 | None':
-    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源碼
python
@overload
+    ...

@overload

def __and__(self, other: Plane3) -> Line3 | None

源碼

在GitHub上查看

python
@overload
 def __and__(self, other: 'Plane3') -> 'Line3 | None':
-    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

變數説明:

  • other:

返回: 不平行平面的交线,平面平行返回None

源碼
python
def __and__(self, other):
+    ...

def __and__(self, other)

説明: 取两平面的交集(人话:交线)

變數説明:

  • other:

返回: 不平行平面的交线,平面平行返回None

源碼

在GitHub上查看

python
def __and__(self, other):
     """
         取两平面的交集(人话:交线)
         Args:
@@ -211,10 +211,10 @@
             return None
         return self.cal_intersection_point3(other)
     else:
-        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

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

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

源碼
python
def __rand__(self, other: 'Line3') -> 'Point3':
+        raise TypeError(f"unsupported operand type(s) for &: 'Plane3' and '{type(other)}'")

def __eq__(self, other) -> bool

源碼

在GitHub上查看

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

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

源碼

在GitHub上查看

python
def __rand__(self, other: 'Line3') -> 'Point3':
     return self.cal_intersection_point3(other)

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/point.html b/zht/api/mp_math/point.html index 679daf1..f60f32a 100644 --- a/zht/api/mp_math/point.html +++ b/zht/api/mp_math/point.html @@ -6,19 +6,19 @@ mbcp.mp_math.point | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

變數説明:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源碼
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.point

説明: 本模块定义了三维空间中点的类。

class Point3

def __init__(self, x: float, y: float, z: float)

説明: 笛卡尔坐标系中的点。

變數説明:

  • x: x 坐标
  • y: y 坐标
  • z: z 坐标
源碼

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         笛卡尔坐标系中的点。
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼
python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Point3, epsilon: float = APPROX) -> bool

説明: 判断两个点是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Point3', epsilon: float=APPROX) -> bool:
     """
         判断两个点是否近似相等。
         Args:
@@ -38,11 +38,11 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源碼
python
@overload
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

@overload

def self + other: Vector3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Point3':
-    ...

@overload

def self + other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: P + V -> P P + P -> P

變數説明:

  • other:
源碼
python
def __add__(self, other):
+    ...

def self + other

説明: P + V -> P P + P -> P

變數説明:

  • other:
源碼

在GitHub上查看

python
def __add__(self, other):
     """
         P + V -> P
         P + P -> P
@@ -50,14 +50,14 @@
             other:
         Returns:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

變數説明:

  • other:
源碼
python
def __eq__(self, other):
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

def __eq__(self, other)

説明: 判断两个点是否相等。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个点是否相等。
         Args:
             other:
         Returns:
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

變數説明:

  • other:
源碼
python
def __sub__(self, other: 'Point3') -> 'Vector3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self - other: Point3 => Vector3

説明: P - P -> V

P - V -> P 已在 :class:Vector3 中实现

變數説明:

  • other:
源碼

在GitHub上查看

python
def __sub__(self, other: 'Point3') -> 'Vector3':
     """
         P - P -> V
 
@@ -69,7 +69,7 @@
         """
     from .vector import Vector3
     return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/segment.html b/zht/api/mp_math/segment.html index e20c4c4..f8a647c 100644 --- a/zht/api/mp_math/segment.html +++ b/zht/api/mp_math/segment.html @@ -6,19 +6,19 @@ mbcp.mp_math.segment | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

源碼
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
+    
Skip to content

mbcp.mp_math.segment

説明: 本模块定义了三维空间中的线段类

class Segment3

def __init__(self, p1: Point3, p2: Point3)

説明: 三维空间中的线段。 :param p1: :param p2:

源碼

在GitHub上查看

python
def __init__(self, p1: 'Point3', p2: 'Point3'):
     """
         三维空间中的线段。
         :param p1:
@@ -32,7 +32,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)

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/utils.html b/zht/api/mp_math/utils.html index 83a95ce..265b9dd 100644 --- a/zht/api/mp_math/utils.html +++ b/zht/api/mp_math/utils.html @@ -6,19 +6,19 @@ mbcp.mp_math.utils | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

變數説明:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源碼
python
def clamp(x: float, min_: float, max_: float) -> float:
+    
Skip to content

mbcp.mp_math.utils

説明: 本模块定义了一些常用的工具函数

def clamp(x: float, min_: float, max_: float) -> float

説明: 区间限定函数

變數説明:

  • x: 待限定的值
  • min_: 最小值
  • max_: 最大值

返回: 限制后的值

源碼

在GitHub上查看

python
def clamp(x: float, min_: float, max_: float) -> float:
     """
     区间限定函数
     Args:
@@ -29,8 +29,8 @@
     Returns:
         限制后的值
     """
-    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源碼
python
def __init__(self, value: RealNumber):
-    self.value = value

def __eq__(self, other)

源碼
python
def __eq__(self, other):
+    return max(min(x, max_), min_)

class Approx

def __init__(self, value: RealNumber)

源碼

在GitHub上查看

python
def __init__(self, value: RealNumber):
+    self.value = value

def __eq__(self, other)

源碼

在GitHub上查看

python
def __eq__(self, other):
     if isinstance(self.value, (float, int)):
         if isinstance(other, (float, int)):
             return abs(self.value - other) < APPROX
@@ -40,9 +40,9 @@
         if isinstance(other, (Vector3, Point3, Plane3, Line3)):
             return all([approx(self.value.x, other.x), approx(self.value.y, other.y), approx(self.value.z, other.z)])
         else:
-            self.raise_type_error(other)

def raise_type_error(self, other)

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

def __ne__(self, other)

源碼
python
def __ne__(self, other):
-    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

變數説明:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源碼
python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
+            self.raise_type_error(other)

def raise_type_error(self, other)

源碼

在GitHub上查看

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

def __ne__(self, other)

源碼

在GitHub上查看

python
def __ne__(self, other):
+    return not self.__eq__(other)

def approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool

説明: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。

變數説明:

  • x: 数1
  • y: 数2
  • epsilon: 误差

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(x: float, y: float=0.0, epsilon: float=APPROX) -> bool:
     """
     判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。
     Args:
@@ -52,7 +52,7 @@
     Returns:
         是否近似相等
     """
-    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼
python
def sign(x: float, only_neg: bool=False) -> str:
+    return abs(x - y) < epsilon

def sign(x: float, only_neg: bool = False) -> str

説明: 获取数的符号。

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼

在GitHub上查看

python
def sign(x: float, only_neg: bool=False) -> str:
     """获取数的符号。
     Args:
         x: 数
@@ -65,7 +65,7 @@
     elif x < 0:
         return '-'
     else:
-        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼
python
def sign_format(x: float, only_neg: bool=False) -> str:
+        return ''

def sign_format(x: float, only_neg: bool = False) -> str

説明: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""

變數説明:

  • x: 数
  • only_neg: 是否只返回负数的符号

返回: 符号 + - ""

源碼

在GitHub上查看

python
def sign_format(x: float, only_neg: bool=False) -> str:
     """格式化符号数
     -1 -> -1
     1 -> +1
@@ -82,7 +82,7 @@
         return f'-{abs(x)}'
     else:
         return ''

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/mp_math/vector.html b/zht/api/mp_math/vector.html index e84940e..b0c2a2c 100644 --- a/zht/api/mp_math/vector.html +++ b/zht/api/mp_math/vector.html @@ -6,19 +6,19 @@ mbcp.mp_math.vector | MBCP 文檔 - + - + -
Skip to content

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

變數説明:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源碼
python
def __init__(self, x: float, y: float, z: float):
+    
Skip to content

mbcp.mp_math.vector

説明: 本模块定义了3维向量的类Vector3,以及一些常用的向量。

class Vector3

def __init__(self, x: float, y: float, z: float)

説明: 3维向量

變數説明:

  • x: x轴分量
  • y: y轴分量
  • z: z轴分量
源碼

在GitHub上查看

python
def __init__(self, x: float, y: float, z: float):
     """
         3维向量
         Args:
@@ -28,7 +28,7 @@
         """
     self.x = x
     self.y = y
-    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼
python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    self.z = z

def approx(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似相等。

變數説明:

  • other:
  • epsilon:

返回: 是否近似相等

源碼

在GitHub上查看

python
def approx(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似相等。
         Args:
@@ -38,7 +38,7 @@
         Returns:
             是否近似相等
         """
-    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

變數説明:

  • other: 另一个向量

返回: 夹角

源碼
python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
+    return all([abs(self.x - other.x) < epsilon, abs(self.y - other.y) < epsilon, abs(self.z - other.z) < epsilon])

def cal_angle(self, other: Vector3) -> AnyAngle

説明: 计算两个向量之间的夹角。

變數説明:

  • other: 另一个向量

返回: 夹角

源碼

在GitHub上查看

python
def cal_angle(self, other: 'Vector3') -> 'AnyAngle':
     """
         计算两个向量之间的夹角。
         Args:
@@ -46,7 +46,7 @@
         Returns:
             夹角
         """
-    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

變數説明:

  • other:

返回: 行列式的结果

源碼
python
def cross(self, other: 'Vector3') -> 'Vector3':
+    return AnyAngle(math.acos(self @ other / (self.length * other.length)), is_radian=True)

def cross(self, other: Vector3) -> Vector3

説明: 向量积 叉乘:v1 cross v2 -> v3

叉乘为0,则两向量平行。 其余结果的模为平行四边形的面积。

變數説明:

  • other:

返回: 行列式的结果

源碼

在GitHub上查看

python
def cross(self, other: 'Vector3') -> 'Vector3':
     """
         向量积 叉乘:v1 cross v2 -> v3
 
@@ -66,7 +66,7 @@
         Returns:
             行列式的结果
         """
-    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

變數説明:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源碼
python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
+    return Vector3(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x)

def is_approx_parallel(self, other: Vector3, epsilon: float = APPROX) -> bool

説明: 判断两个向量是否近似平行。

變數説明:

  • other: 另一个向量
  • epsilon: 允许的误差

返回: 是否近似平行

源碼

在GitHub上查看

python
def is_approx_parallel(self, other: 'Vector3', epsilon: float=APPROX) -> bool:
     """
         判断两个向量是否近似平行。
         Args:
@@ -75,7 +75,7 @@
         Returns:
             是否近似平行
         """
-    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

變數説明:

  • other: 另一个向量

返回: 是否平行

源碼
python
def is_parallel(self, other: 'Vector3') -> bool:
+    return self.cross(other).length < epsilon

def is_parallel(self, other: Vector3) -> bool

説明: 判断两个向量是否平行。

變數説明:

  • other: 另一个向量

返回: 是否平行

源碼

在GitHub上查看

python
def is_parallel(self, other: 'Vector3') -> bool:
     """
         判断两个向量是否平行。
         Args:
@@ -83,7 +83,7 @@
         Returns:
             是否平行
         """
-    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

源碼
python
def normalize(self):
+    return self.cross(other).approx(zero_vector3)

def normalize(self)

説明: 将向量归一化。

自体归一化,不返回值。

源碼

在GitHub上查看

python
def normalize(self):
     """
         将向量归一化。
 
@@ -92,32 +92,32 @@
     length = self.length
     self.x /= length
     self.y /= length
-    self.z /= length

@property

def np_array(self) -> np.ndarray

源碼
python
@property
+    self.z /= length

@property

def np_array(self) -> np.ndarray

源碼

在GitHub上查看

python
@property
 def np_array(self) -> 'np.ndarray':
     """
         返回numpy数组
         Returns:
         """
-    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

返回: 模

源碼
python
@property
+    return np.array([self.x, self.y, self.z])

@property

def length(self) -> float

説明: 向量的模。

返回: 模

源碼

在GitHub上查看

python
@property
 def length(self) -> float:
     """
         向量的模。
         Returns:
 
         """
-    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

返回: 单位向量

源碼
python
@property
+    return math.sqrt(self.x ** 2 + self.y ** 2 + self.z ** 2)

@property

def unit(self) -> Vector3

説明: 获取该向量的单位向量。

返回: 单位向量

源碼

在GitHub上查看

python
@property
 def unit(self) -> 'Vector3':
     """
         获取该向量的单位向量。
         Returns:
             单位向量
         """
-    return self / self.length

def __abs__(self)

源碼
python
def __abs__(self):
-    return self.length

@overload

def self + other: Vector3 => Vector3

源碼
python
@overload
+    return self / self.length

def __abs__(self)

源碼

在GitHub上查看

python
def __abs__(self):
+    return self.length

@overload

def self + other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self + other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self + other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __add__(self, other: 'Point3') -> 'Point3':
-    ...

def self + other

説明: V + P -> P

V + V -> V

變數説明:

  • other:
源碼
python
def __add__(self, other):
+    ...

def self + other

説明: V + P -> P

V + V -> V

變數説明:

  • other:
源碼

在GitHub上查看

python
def __add__(self, other):
     """
         V + P -> P
 
@@ -132,7 +132,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x + other.x, self.y + other.y, self.z + other.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

變數説明:

  • other:

返回: 是否相等

源碼
python
def __eq__(self, other):
+        raise TypeError(f"unsupported operand type(s) for +: 'Vector3' and '{type(other)}'")

def __eq__(self, other)

説明: 判断两个向量是否相等。

變數説明:

  • other:

返回: 是否相等

源碼

在GitHub上查看

python
def __eq__(self, other):
     """
         判断两个向量是否相等。
         Args:
@@ -140,7 +140,7 @@
         Returns:
             是否相等
         """
-    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

源碼
python
def __radd__(self, other: 'Point3') -> 'Point3':
+    return approx(self.x, other.x) and approx(self.y, other.y) and approx(self.z, other.z)

def self + other: Point3 => Point3

説明: P + V -> P

别去点那边实现了。 :param other: :return:

源碼

在GitHub上查看

python
def __radd__(self, other: 'Point3') -> 'Point3':
     """
         P + V -> P
 
@@ -148,11 +148,11 @@
         :param other:
         :return:
         """
-    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源碼
python
@overload
+    return Point3(self.x + other.x, self.y + other.y, self.z + other.z)

@overload

def self - other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self - other: Point3 => Point3

源碼
python
@overload
+    ...

@overload

def self - other: Point3 => Point3

源碼

在GitHub上查看

python
@overload
 def __sub__(self, other: 'Point3') -> 'Point3':
-    ...

def self - other

説明: V - P -> P

V - V -> V

變數説明:

  • other:
源碼
python
def __sub__(self, other):
+    ...

def self - other

説明: V - P -> P

V - V -> V

變數説明:

  • other:
源碼

在GitHub上查看

python
def __sub__(self, other):
     """
         V - P -> P
 
@@ -166,7 +166,7 @@
     elif isinstance(other, Point3):
         return Point3(self.x - other.x, self.y - other.y, self.z - other.z)
     else:
-        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

變數説明:

  • other:
源碼
python
def __rsub__(self, other: 'Point3'):
+        raise TypeError(f'unsupported operand type(s) for -: "Vector3" and "{type(other)}"')

def self - other: Point3

説明: P - V -> P

變數説明:

  • other:
源碼

在GitHub上查看

python
def __rsub__(self, other: 'Point3'):
     """
         P - V -> P
         Args:
@@ -177,11 +177,11 @@
     if isinstance(other, Point3):
         return Point3(other.x - self.x, other.y - self.y, other.z - self.z)
     else:
-        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源碼
python
@overload
+        raise TypeError(f"unsupported operand type(s) for -: '{type(other)}' and 'Vector3'")

@overload

def self * other: Vector3 => Vector3

源碼

在GitHub上查看

python
@overload
 def __mul__(self, other: 'Vector3') -> 'Vector3':
-    ...

@overload

def self * other: RealNumber => Vector3

源碼
python
@overload
+    ...

@overload

def self * other: RealNumber => Vector3

源碼

在GitHub上查看

python
@overload
 def __mul__(self, other: RealNumber) -> 'Vector3':
-    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

變數説明:

  • other:
源碼
python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
+    ...

def self * other: int | float | Vector3 => Vector3

説明: 数组运算 非点乘。点乘使用@,叉乘使用cross。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __mul__(self, other: 'int | float | Vector3') -> 'Vector3':
     """
         数组运算 非点乘。点乘使用@,叉乘使用cross。
         Args:
@@ -194,18 +194,18 @@
     elif isinstance(other, (float, int)):
         return Vector3(self.x * other, self.y * other, self.z * other)
     else:
-        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源碼
python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
-    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

變數説明:

  • other:
源碼
python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
+        raise TypeError(f"unsupported operand type(s) for *: 'Vector3' and '{type(other)}'")

def self * other: RealNumber => Vector3

源碼

在GitHub上查看

python
def __rmul__(self, other: 'RealNumber') -> 'Vector3':
+    return self.__mul__(other)

def self @ other: Vector3 => RealNumber

説明: 点乘。

變數説明:

  • other:
源碼

在GitHub上查看

python
def __matmul__(self, other: 'Vector3') -> 'RealNumber':
     """
         点乘。
         Args:
             other:
         Returns:
         """
-    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

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

def - self

源碼
python
def __neg__(self):
+    return self.x * other.x + self.y * other.y + self.z * other.z

def self / other: RealNumber => Vector3

源碼

在GitHub上查看

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

def - self

源碼

在GitHub上查看

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

var zero_vector3 = Vector3(0, 0, 0)

  • 類型: Vector3

  • 説明: 零向量

var x_axis = Vector3(1, 0, 0)

  • 類型: Vector3

  • 説明: x轴单位向量

var y_axis = Vector3(0, 1, 0)

  • 類型: Vector3

  • 説明: y轴单位向量

var z_axis = Vector3(0, 0, 1)

  • 類型: Vector3

  • 説明: z轴单位向量

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/particle/index.html b/zht/api/particle/index.html index d5265f0..f082214 100644 --- a/zht/api/particle/index.html +++ b/zht/api/particle/index.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP 文檔 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/zht/api/particle/particle.html b/zht/api/particle/particle.html index a6dec48..21c16c3 100644 --- a/zht/api/particle/particle.html +++ b/zht/api/particle/particle.html @@ -6,7 +6,7 @@ mbcp.particle | MBCP 文檔 - + @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/zht/api/presets/index.html b/zht/api/presets/index.html index 22725fe..b461a98 100644 --- a/zht/api/presets/index.html +++ b/zht/api/presets/index.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

説明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/presets/model/index.html b/zht/api/presets/model/index.html index cbd84d3..228d032 100644 --- a/zht/api/presets/model/index.html +++ b/zht/api/presets/model/index.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP 文檔 - + - + -
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼
python
@staticmethod
+    
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/presets/model/model.html b/zht/api/presets/model/model.html index ab5f60d..3204505 100644 --- a/zht/api/presets/model/model.html +++ b/zht/api/presets/model/model.html @@ -6,19 +6,19 @@ mbcp.presets.model | MBCP 文檔 - + - + -
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼
python
@staticmethod
+    
Skip to content

mbcp.presets.model

説明: 几何模型点集

class GeometricModels

@staticmethod

def sphere(radius: float, density: float)

説明: 生成球体上的点集。

變數説明:

  • radius:
  • density:

返回: List[Point3]: 球体上的点集。

源碼

在GitHub上查看

python
@staticmethod
 def sphere(radius: float, density: float):
     """
         生成球体上的点集。
@@ -36,7 +36,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)]

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/api/presets/presets.html b/zht/api/presets/presets.html index f062bd5..40b807e 100644 --- a/zht/api/presets/presets.html +++ b/zht/api/presets/presets.html @@ -6,7 +6,7 @@ mbcp.presets | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

mbcp.presets

説明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved

@Time : 2024/8/12 下午9:12 @Author : snowykami @Email : snowykami@outlook.com @File : init.py @Software: PyCharm

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/guide/index.html b/zht/guide/index.html index 129b236..9a66565 100644 --- a/zht/guide/index.html +++ b/zht/guide/index.html @@ -6,7 +6,7 @@ 开始不了一点 | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

开始不了一点

12x111

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/index.html b/zht/index.html index a56c680..98caceb 100644 --- a/zht/index.html +++ b/zht/index.html @@ -6,7 +6,7 @@ MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

MBCP

更多基礎變化粒子

用於幾何運算和 當個創世神 粒子製作的軟體庫

MBCP logo

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file diff --git a/zht/refer/index.html b/zht/refer/index.html index 493d94c..2f61480 100644 --- a/zht/refer/index.html +++ b/zht/refer/index.html @@ -6,7 +6,7 @@ Reference | MBCP 文檔 - + @@ -19,7 +19,7 @@
Skip to content

Reference

Help us to improve the documentation

文檔由 VitePress 構建 | API引用由 litedoc 生成

- + \ No newline at end of file