mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-22 14:17:38 +08:00
Deploying to docs from @ snowykami/mbcp@e8ddadbd18 🚀
This commit is contained in:
parent
12e3c9ae19
commit
b326ba0418
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/api_mp_math_angle.md.cWbp_yRf.js
Normal file
1
assets/api_mp_math_angle.md.cWbp_yRf.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as a,o as i,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),e={name:"api/mp_math/angle.md"},n=t("",80),h=[n];function l(p,k,r,o,d,g){return i(),a("div",null,h)}const c=s(e,[["render",l]]);export{m as __pageData,c as default};
|
||||
import{_ as s,c as a,o as i,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"zh/api/mp_math/angle.md"}'),e={name:"api/mp_math/angle.md"},n=t("",99),h=[n];function l(p,r,k,o,d,g){return i(),a("div",null,h)}const c=s(e,[["render",l]]);export{m as __pageData,c as default};
|
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n(`<h1 id="模块-mbcp-mp-math-equation" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#模块-mbcp-mp-math-equation" aria-label="Permalink to "**模块** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>说明</strong>: 曲线方程。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n(`<h1 id="模块-mbcp-mp-math-equation" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#模块-mbcp-mp-math-equation" aria-label="Permalink to "**模块** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><hr><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>说明</strong>: 曲线方程。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>说明</strong>: 计算曲线上的点。</p><p><strong>参数</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>返回</strong>: 目标点</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><hr><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>说明</strong>: 计算曲线上的点。</p><p><strong>参数</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>返回</strong>: 目标点</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> len</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(t) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>说明</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>参数</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>返回</strong>: 偏导函数</p><p><strong>引发</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><hr><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>说明</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>参数</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>返回</strong>: 偏导函数</p><p><strong>引发</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(var, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||
@ -24,4 +24,4 @@ import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high_order_partial_derivative_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,23),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,26),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"zh/api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n("",26),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
12
assets/api_mp_math_function.md.BwtjCYfY.js
Normal file
12
assets/api_mp_math_function.md.BwtjCYfY.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as n,c as s,j as t,a as Q,a4 as a,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),T={name:"api/mp_math/function.md"},e=a("",4),l={class:"tip custom-block github-alert"},h=t("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},p=a("",1),o=[p],m=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",null,","),t("mi",null,"y"),t("mo",null,","),t("mi",null,"z"),t("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=a("",1),u=[g],y=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("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"},_=a("",1),w=[_],x=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",{mathvariant:"normal"},"∇"),t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"x")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"y")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"z")])]),t("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=a("",13);function L(H,F,M,v,D,Z){return i(),s("div",null,[e,t("div",l,[h,t("p",null,[Q("已知一个函数"),t("mjx-container",r,[(i(),s("svg",d,o)),m]),Q(",则其在点"),t("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),t("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
||||
import{_ as n,c as s,j as t,a as Q,a4 as a,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/function.md","filePath":"zh/api/mp_math/function.md"}'),T={name:"api/mp_math/function.md"},e=a("",5),l={class:"tip custom-block github-alert"},h=t("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},p=a("",1),o=[p],m=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",null,","),t("mi",null,"y"),t("mo",null,","),t("mi",null,"z"),t("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=a("",1),u=[g],y=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("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"},_=a("",1),w=[_],x=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",{mathvariant:"normal"},"∇"),t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"x")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"y")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"z")])]),t("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=a("",14);function L(H,F,M,v,D,Z){return i(),s("div",null,[e,t("div",l,[h,t("p",null,[Q("已知一个函数"),t("mjx-container",r,[(i(),s("svg",d,o)),m]),Q(",则其在点"),t("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),t("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
File diff suppressed because one or more lines are too long
44
assets/api_mp_math_line.md.DWuJmkor.js
Normal file
44
assets/api_mp_math_line.md.DWuJmkor.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
87
assets/api_mp_math_plane.md.DtvqG-Rt.js
Normal file
87
assets/api_mp_math_plane.md.DtvqG-Rt.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/api_mp_math_point.md.DsVbhrSK.js
Normal file
1
assets/api_mp_math_point.md.DsVbhrSK.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),e={name:"api/mp_math/point.md"},h=t("",39),n=[h];function l(p,o,k,r,d,g){return a(),i("div",null,n)}const y=s(e,[["render",l]]);export{c as __pageData,y as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"zh/api/mp_math/point.md"}'),h={name:"api/mp_math/point.md"},e=t("",46),n=[e];function l(p,o,k,r,d,g){return a(),i("div",null,n)}const y=s(h,[["render",l]]);export{c as __pageData,y as default};
|
@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),n={name:"ja/api/mp_math/segment.md"},h=t(`<h1 id="モジュール-mbcp-mp-math-segment" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-segment" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>説明</strong>: 三维空间中的线段。</p><p><strong>引数</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),n={name:"api/mp_math/segment.md"},h=t(`<h1 id="模块-mbcp-mp-math-segment" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#模块-mbcp-mp-math-segment" aria-label="Permalink to "**模块** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><hr><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>说明</strong>: 三维空间中的线段。</p><p><strong>参数</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p1</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '方向向量'</span></span>
|
||||
@ -6,4 +6,4 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '长度'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.length </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.length</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '中心点'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,8),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,9),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),n={name:"api/mp_math/segment.md"},h=t("",8),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),n={name:"api/mp_math/segment.md"},h=t("",9),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
@ -1,6 +1,6 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},n=t(`<h1 id="模块-mbcp-mp-math-utils" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.utils</code> <a class="header-anchor" href="#模块-mbcp-mp-math-utils" aria-label="Permalink to "**模块** \`mbcp.mp_math.utils\`""></a></h1><p>本模块定义了一些常用的工具函数</p><h3 id="func-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>func</strong></em> <code>clamp(x: float, min_: float, max_: float) -> float</code> <a class="header-anchor" href="#func-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***func*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p><strong>说明</strong>: 区间限定函数</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 值</li><li>min_ (<code>float</code>): 最小值</li><li>max_ (<code>float</code>): 最大值</li></ul></blockquote><p><strong>返回</strong>: <code>float</code>: 限定在区间内的值</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L17" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> max</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x, max_), min_)</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><h4 id="method-init-self-value-realnumber" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#method-init-self-value-realnumber" aria-label="Permalink to "***method*** \`__init__(self, value: RealNumber)\`""></a></h4><p><strong>说明</strong>: 用于近似比较对象</p><p><strong>参数</strong>:</p><blockquote><ul><li>value (<a href="./mp_math_typing.html#realnumber"><code>RealNumber</code></a>): 实数</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L36" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><h4 id="method-self-other" tabindex="-1"><em><strong>method</strong></em> <code>self == other</code> <a class="header-anchor" href="#method-self-other" aria-label="Permalink to "***method*** \`self == other\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L44" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},n=t(`<h1 id="模块-mbcp-mp-math-utils" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.utils</code> <a class="header-anchor" href="#模块-mbcp-mp-math-utils" aria-label="Permalink to "**模块** \`mbcp.mp_math.utils\`""></a></h1><p>本模块定义了一些常用的工具函数</p><hr><h3 id="func-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>func</strong></em> <code>clamp(x: float, min_: float, max_: float) -> float</code> <a class="header-anchor" href="#func-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***func*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p><strong>说明</strong>: 区间限定函数</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 值</li><li>min_ (<code>float</code>): 最小值</li><li>max_ (<code>float</code>): 最大值</li></ul></blockquote><p><strong>返回</strong>: <code>float</code>: 限定在区间内的值</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L17" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> max</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x, max_), min_)</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><hr><h4 id="method-init-self-value-realnumber" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#method-init-self-value-realnumber" aria-label="Permalink to "***method*** \`__init__(self, value: RealNumber)\`""></a></h4><p><strong>说明</strong>: 用于近似比较对象</p><p><strong>参数</strong>:</p><blockquote><ul><li>value (<a href="./mp_math_typing.html#realnumber"><code>RealNumber</code></a>): 实数</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L36" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><hr><h4 id="method-self-other" tabindex="-1"><em><strong>method</strong></em> <code>self == other</code> <a class="header-anchor" href="#method-self-other" aria-label="Permalink to "***method*** \`self == other\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L44" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> APPROX</span></span>
|
||||
@ -10,19 +10,19 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (Vector3, Point3, Plane3, Line3)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> all</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.x, other.x), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.y, other.y), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.z, other.z)])</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span></code></pre></div></details><h4 id="method-raise-type-error-self-other" tabindex="-1"><em><strong>method</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#method-raise-type-error-self-other" aria-label="Permalink to "***method*** \`raise_type_error(self, other)\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L56" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h4 id="method-self-other-1" tabindex="-1"><em><strong>method</strong></em> <code>self != other</code> <a class="header-anchor" href="#method-self-other-1" aria-label="Permalink to "***method*** \`self != other\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L59" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __ne__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span></span></code></pre></div></details><h3 id="func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>func</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool</code> <a class="header-anchor" href="#func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to "***func*** \`approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool\`""></a></h3><p><strong>说明</strong>: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数1</li><li>y (<code>float</code>): 数2</li><li>epsilon (<code>float</code>): 误差</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>: 是否近似相等</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L63" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><h3 id="func-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>说明</strong>: 获取数的符号。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L76" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span></code></pre></div></details><hr><h4 id="method-raise-type-error-self-other" tabindex="-1"><em><strong>method</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#method-raise-type-error-self-other" aria-label="Permalink to "***method*** \`raise_type_error(self, other)\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L56" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h4 id="method-self-other-1" tabindex="-1"><em><strong>method</strong></em> <code>self != other</code> <a class="header-anchor" href="#method-self-other-1" aria-label="Permalink to "***method*** \`self != other\`""></a></h4><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L59" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __ne__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span></span></code></pre></div></details><hr><h3 id="func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>func</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool</code> <a class="header-anchor" href="#func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to "***func*** \`approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool\`""></a></h3><p><strong>说明</strong>: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数1</li><li>y (<code>float</code>): 数2</li><li>epsilon (<code>float</code>): 误差</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>: 是否近似相等</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L63" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><hr><h3 id="func-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>说明</strong>: 获取数的符号。</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L76" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '+'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '-'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><h3 id="func-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign_format(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign_format(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>说明</strong>: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L92" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="func-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign_format(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign_format(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>说明</strong>: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""</p><p><strong>参数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>返回</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L92" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details>`,38),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details>`,46),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},n=t("",38),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"zh/api/mp_math/utils.md"}'),l={name:"api/mp_math/utils.md"},n=t("",46),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
1
assets/api_mp_math_vector.md.BOBPMTV2.js
Normal file
1
assets/api_mp_math_vector.md.BOBPMTV2.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),h={name:"api/presets/model/index.md"},n=t(`<h1 id="模块-mbcp-presets-model" tabindex="-1"><strong>模块</strong> <code>mbcp.presets.model</code> <a class="header-anchor" href="#模块-mbcp-presets-model" aria-label="Permalink to "**模块** \`mbcp.presets.model\`""></a></h1><p>几何模型点集</p><h3 id="class-geometricmodels" tabindex="-1"><em><strong>class</strong></em> <code>GeometricModels</code> <a class="header-anchor" href="#class-geometricmodels" aria-label="Permalink to "***class*** \`GeometricModels\`""></a></h3><p><a href="https://docs.python.org/3/library/functions.html#staticmethod" target="_blank" rel="noreferrer"><code>@staticmethod</code></a></p><h4 id="method-sphere-radius-float-density-float" tabindex="-1"><em><strong>method</strong></em> <code>sphere(radius: float, density: float)</code> <a class="header-anchor" href="#method-sphere-radius-float-density-float" aria-label="Permalink to "***method*** \`sphere(radius: float, density: float)\`""></a></h4><p><strong>说明</strong>: 生成球体上的点集。</p><p><strong>参数</strong>:</p><blockquote><ul><li>radius:</li><li>density:</li></ul></blockquote><p><strong>返回</strong>: List[Point3]: 球体上的点集。</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/presets/model/__init__.py#L12" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),h={name:"api/presets/model/index.md"},n=t(`<h1 id="模块-mbcp-presets-model" tabindex="-1"><strong>模块</strong> <code>mbcp.presets.model</code> <a class="header-anchor" href="#模块-mbcp-presets-model" aria-label="Permalink to "**模块** \`mbcp.presets.model\`""></a></h1><p>几何模型点集</p><h3 id="class-geometricmodels" tabindex="-1"><em><strong>class</strong></em> <code>GeometricModels</code> <a class="header-anchor" href="#class-geometricmodels" aria-label="Permalink to "***class*** \`GeometricModels\`""></a></h3><hr><p><a href="https://docs.python.org/3/library/functions.html#staticmethod" target="_blank" rel="noreferrer"><code>@staticmethod</code></a></p><h4 id="method-sphere-radius-float-density-float" tabindex="-1"><em><strong>method</strong></em> <code>sphere(radius: float, density: float)</code> <a class="header-anchor" href="#method-sphere-radius-float-density-float" aria-label="Permalink to "***method*** \`sphere(radius: float, density: float)\`""></a></h4><p><strong>说明</strong>: 生成球体上的点集。</p><p><strong>参数</strong>:</p><blockquote><ul><li>radius:</li><li>density:</li></ul></blockquote><p><strong>返回</strong>: List[Point3]: 球体上的点集。</p><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/presets/model/__init__.py#L12" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sphere</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(radius: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, density: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 4</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> density)</span></span>
|
||||
@ -7,4 +7,4 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(theta_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(theta_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(phi_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details>`,10),l=[n];function e(p,k,r,d,E,o){return a(),i("div",null,l)}const c=s(h,[["render",e]]);export{y as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details>`,11),l=[n];function e(p,k,r,d,E,o){return a(),i("div",null,l)}const c=s(h,[["render",e]]);export{y as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),h={name:"api/presets/model/index.md"},n=t("",10),l=[n];function e(p,k,r,d,E,o){return a(),i("div",null,l)}const c=s(h,[["render",e]]);export{y as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"zh/api/presets/model/index.md"}'),h={name:"api/presets/model/index.md"},n=t("",11),l=[n];function e(p,k,r,d,E,o){return a(),i("div",null,l)}const c=s(h,[["render",e]]);export{y as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{t as p}from"./chunks/theme.D-IvjCkA.js";import{U as o,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,ae as y,d as P,u as v,y as C,x as b,af as w,ag as E,ah as R,ai as S}from"./chunks/framework.DpC1ZpOZ.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(p),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return C(()=>{b(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&w(),E(),R(),s.setup&&s.setup(),()=>S(s.Layout)}});async function x(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function D(){return g(T)}function _(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&x().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{x as createApp};
|
||||
import{t as p}from"./chunks/theme.BDrzRUX0.js";import{U as o,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,ae as y,d as P,u as v,y as C,x as b,af as w,ag as E,ah as R,ai as S}from"./chunks/framework.DpC1ZpOZ.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(p),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return C(()=>{b(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&w(),E(),R(),s.setup&&s.setup(),()=>S(s.Layout)}});async function x(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function D(){return g(T)}function _(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&x().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{x as createApp};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/chunks/@localSearchIndexja.t97TSkap.js
Normal file
1
assets/chunks/@localSearchIndexja.t97TSkap.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/chunks/@localSearchIndexzht.BgJwRtJS.js
Normal file
1
assets/chunks/@localSearchIndexzht.BgJwRtJS.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/en_api_mp_math_angle.md.peSqhdX7.js
Normal file
1
assets/en_api_mp_math_angle.md.peSqhdX7.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/angle.md","filePath":"en/api/mp_math/angle.md"}'),e={name:"en/api/mp_math/angle.md"},n=t("",80),h=[n];function l(p,r,k,o,d,g){return a(),i("div",null,h)}const m=s(e,[["render",l]]);export{c as __pageData,m as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/angle.md","filePath":"en/api/mp_math/angle.md"}'),e={name:"en/api/mp_math/angle.md"},n=t("",99),h=[n];function l(p,r,k,o,d,g){return a(),i("div",null,h)}const m=s(e,[["render",l]]);export{c as __pageData,m as default};
|
@ -1,11 +1,11 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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(`<h1 id="module-mbcp-mp-math-equation" tabindex="-1"><strong>Module</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#module-mbcp-mp-math-equation" aria-label="Permalink to "**Module** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>Description</strong>: 曲线方程。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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(`<h1 id="module-mbcp-mp-math-equation" tabindex="-1"><strong>Module</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#module-mbcp-mp-math-equation" aria-label="Permalink to "**Module** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><hr><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>Description</strong>: 曲线方程。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>Description</strong>: 计算曲线上的点。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>Return</strong>: 目标点</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><hr><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>Description</strong>: 计算曲线上的点。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>Return</strong>: 目标点</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> len</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(t) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>Description</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>Arguments</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>Return</strong>: 偏导函数</p><p><strong>Raises</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><hr><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>Description</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>Arguments</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>Return</strong>: 偏导函数</p><p><strong>Raises</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(var, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||
@ -24,4 +24,4 @@ import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high_order_partial_derivative_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,23),h=[l];function e(p,k,r,E,d,c){return a(),i("div",null,h)}const o=s(t,[["render",e]]);export{u as __pageData,o as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,26),h=[l];function e(p,k,r,E,d,c){return a(),i("div",null,h)}const o=s(t,[["render",e]]);export{u as __pageData,o as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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),h=[l];function e(p,k,r,E,d,c){return a(),i("div",null,h)}const o=s(t,[["render",e]]);export{u as __pageData,o as default};
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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("",26),h=[l];function e(p,k,r,E,d,c){return a(),i("div",null,h)}const o=s(t,[["render",e]]);export{u as __pageData,o as default};
|
12
assets/en_api_mp_math_function.md.DR6lGYv1.js
Normal file
12
assets/en_api_mp_math_function.md.DR6lGYv1.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as n,c as s,j as t,a as Q,a4 as a,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),T={name:"en/api/mp_math/function.md"},e=a("",4),l={class:"tip custom-block github-alert"},h=t("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},o=a("",1),p=[o],m=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",null,","),t("mi",null,"y"),t("mo",null,","),t("mi",null,"z"),t("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=a("",1),u=[g],y=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("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"},_=a("",1),w=[_],x=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",{mathvariant:"normal"},"∇"),t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"x")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"y")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"z")])]),t("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=a("",13);function L(H,M,F,v,D,Z){return i(),s("div",null,[e,t("div",l,[h,t("p",null,[Q("已知一个函数"),t("mjx-container",r,[(i(),s("svg",d,p)),m]),Q(",则其在点"),t("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),t("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
||||
import{_ as n,c as s,j as t,a as Q,a4 as a,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/function.md","filePath":"en/api/mp_math/function.md"}'),T={name:"en/api/mp_math/function.md"},e=a("",5),l={class:"tip custom-block github-alert"},h=t("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},o=a("",1),p=[o],m=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",null,","),t("mi",null,"y"),t("mo",null,","),t("mi",null,"z"),t("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=a("",1),u=[g],y=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("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"},_=a("",1),w=[_],x=t("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"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mi",{mathvariant:"normal"},"∇"),t("mi",null,"f"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"x"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"y"),t("mn",null,"0")]),t("mo",null,","),t("msub",null,[t("mi",null,"z"),t("mn",null,"0")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"x")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"y")])]),t("mo",null,","),t("mfrac",null,[t("mrow",null,[t("mi",null,"∂"),t("mi",null,"f")]),t("mrow",null,[t("mi",null,"∂"),t("mi",null,"z")])]),t("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=a("",14);function L(H,M,F,v,D,Z){return i(),s("div",null,[e,t("div",l,[h,t("p",null,[Q("已知一个函数"),t("mjx-container",r,[(i(),s("svg",d,p)),m]),Q(",则其在点"),t("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),t("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
File diff suppressed because one or more lines are too long
44
assets/en_api_mp_math_line.md.CMYXxJ26.js
Normal file
44
assets/en_api_mp_math_line.md.CMYXxJ26.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
87
assets/en_api_mp_math_plane.md.QiMgSY7K.js
Normal file
87
assets/en_api_mp_math_plane.md.QiMgSY7K.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/en_api_mp_math_point.md.xl2uoip_.js
Normal file
1
assets/en_api_mp_math_point.md.xl2uoip_.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),e={name:"en/api/mp_math/point.md"},h=t("",39),n=[h];function l(p,o,r,k,d,g){return a(),i("div",null,n)}const y=s(e,[["render",l]]);export{E as __pageData,y as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/point.md","filePath":"en/api/mp_math/point.md"}'),e={name:"en/api/mp_math/point.md"},h=t("",46),n=[h];function l(p,o,r,k,d,g){return a(),i("div",null,n)}const y=s(e,[["render",l]]);export{E as __pageData,y as default};
|
@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),n={name:"en/api/mp_math/segment.md"},h=t(`<h1 id="module-mbcp-mp-math-segment" tabindex="-1"><strong>Module</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#module-mbcp-mp-math-segment" aria-label="Permalink to "**Module** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>Description</strong>: 三维空间中的线段。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),n={name:"en/api/mp_math/segment.md"},h=t(`<h1 id="module-mbcp-mp-math-segment" tabindex="-1"><strong>Module</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#module-mbcp-mp-math-segment" aria-label="Permalink to "**Module** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><hr><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>Description</strong>: 三维空间中的线段。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p1</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '方向向量'</span></span>
|
||||
@ -6,4 +6,4 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '长度'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.length </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.length</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '中心点'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,8),e=[h];function p(l,k,r,d,o,E){return a(),i("div",null,e)}const c=s(n,[["render",p]]);export{m as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,9),e=[h];function p(l,k,r,d,o,E){return a(),i("div",null,e)}const c=s(n,[["render",p]]);export{m as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),n={name:"en/api/mp_math/segment.md"},h=t("",8),e=[h];function p(l,k,r,d,o,E){return a(),i("div",null,e)}const c=s(n,[["render",p]]);export{m as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/segment.md","filePath":"en/api/mp_math/segment.md"}'),n={name:"en/api/mp_math/segment.md"},h=t("",9),e=[h];function p(l,k,r,d,o,E){return a(),i("div",null,e)}const c=s(n,[["render",p]]);export{m as __pageData,c as default};
|
28
assets/en_api_mp_math_utils.md.DL_PJXBC.js
Normal file
28
assets/en_api_mp_math_utils.md.DL_PJXBC.js
Normal file
@ -0,0 +1,28 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),n={name:"en/api/mp_math/utils.md"},l=t(`<h1 id="module-mbcp-mp-math-utils" tabindex="-1"><strong>Module</strong> <code>mbcp.mp_math.utils</code> <a class="header-anchor" href="#module-mbcp-mp-math-utils" aria-label="Permalink to "**Module** \`mbcp.mp_math.utils\`""></a></h1><p>本模块定义了一些常用的工具函数</p><hr><h3 id="func-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>func</strong></em> <code>clamp(x: float, min_: float, max_: float) -> float</code> <a class="header-anchor" href="#func-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***func*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p><strong>Description</strong>: 区间限定函数</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 值</li><li>min_ (<code>float</code>): 最小值</li><li>max_ (<code>float</code>): 最大值</li></ul></blockquote><p><strong>Return</strong>: <code>float</code>: 限定在区间内的值</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L17" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> max</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x, max_), min_)</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><hr><h4 id="method-init-self-value-realnumber" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#method-init-self-value-realnumber" aria-label="Permalink to "***method*** \`__init__(self, value: RealNumber)\`""></a></h4><p><strong>Description</strong>: 用于近似比较对象</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>value (<a href="./mp_math_typing.html#realnumber"><code>RealNumber</code></a>): 实数</li></ul></blockquote><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L36" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><hr><h4 id="method-self-other" tabindex="-1"><em><strong>method</strong></em> <code>self == other</code> <a class="header-anchor" href="#method-self-other" aria-label="Permalink to "***method*** \`self == other\`""></a></h4><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L44" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> APPROX</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value, Vector3):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (Vector3, Point3, Plane3, Line3)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> all</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.x, other.x), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.y, other.y), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.z, other.z)])</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span></code></pre></div></details><hr><h4 id="method-raise-type-error-self-other" tabindex="-1"><em><strong>method</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#method-raise-type-error-self-other" aria-label="Permalink to "***method*** \`raise_type_error(self, other)\`""></a></h4><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L56" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h4 id="method-self-other-1" tabindex="-1"><em><strong>method</strong></em> <code>self != other</code> <a class="header-anchor" href="#method-self-other-1" aria-label="Permalink to "***method*** \`self != other\`""></a></h4><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L59" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __ne__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span></span></code></pre></div></details><hr><h3 id="func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>func</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool</code> <a class="header-anchor" href="#func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to "***func*** \`approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool\`""></a></h3><p><strong>Description</strong>: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数1</li><li>y (<code>float</code>): 数2</li><li>epsilon (<code>float</code>): 误差</li></ul></blockquote><p><strong>Return</strong>: <a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>: 是否近似相等</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L63" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><hr><h3 id="func-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>Description</strong>: 获取数的符号。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>Return</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L76" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '+'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '-'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="func-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign_format(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign_format(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>Description</strong>: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>Return</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L92" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details>`,46),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{E as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),n={name:"en/api/mp_math/utils.md"},l=t("",38),e=[l];function h(p,k,r,o,d,g){return a(),i("div",null,e)}const c=s(n,[["render",h]]);export{E as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"en/api/mp_math/utils.md","filePath":"en/api/mp_math/utils.md"}'),n={name:"en/api/mp_math/utils.md"},l=t("",46),h=[l];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(n,[["render",e]]);export{E as __pageData,c as default};
|
1
assets/en_api_mp_math_vector.md.BuCQiBiJ.js
Normal file
1
assets/en_api_mp_math_vector.md.BuCQiBiJ.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),h={name:"en/api/presets/model/index.md"},n=t(`<h1 id="module-mbcp-presets-model" tabindex="-1"><strong>Module</strong> <code>mbcp.presets.model</code> <a class="header-anchor" href="#module-mbcp-presets-model" aria-label="Permalink to "**Module** \`mbcp.presets.model\`""></a></h1><p>几何模型点集</p><h3 id="class-geometricmodels" tabindex="-1"><em><strong>class</strong></em> <code>GeometricModels</code> <a class="header-anchor" href="#class-geometricmodels" aria-label="Permalink to "***class*** \`GeometricModels\`""></a></h3><p><a href="https://docs.python.org/3/library/functions.html#staticmethod" target="_blank" rel="noreferrer"><code>@staticmethod</code></a></p><h4 id="method-sphere-radius-float-density-float" tabindex="-1"><em><strong>method</strong></em> <code>sphere(radius: float, density: float)</code> <a class="header-anchor" href="#method-sphere-radius-float-density-float" aria-label="Permalink to "***method*** \`sphere(radius: float, density: float)\`""></a></h4><p><strong>Description</strong>: 生成球体上的点集。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>radius:</li><li>density:</li></ul></blockquote><p><strong>Return</strong>: List[Point3]: 球体上的点集。</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/presets/model/__init__.py#L12" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),h={name:"en/api/presets/model/index.md"},n=t(`<h1 id="module-mbcp-presets-model" tabindex="-1"><strong>Module</strong> <code>mbcp.presets.model</code> <a class="header-anchor" href="#module-mbcp-presets-model" aria-label="Permalink to "**Module** \`mbcp.presets.model\`""></a></h1><p>几何模型点集</p><h3 id="class-geometricmodels" tabindex="-1"><em><strong>class</strong></em> <code>GeometricModels</code> <a class="header-anchor" href="#class-geometricmodels" aria-label="Permalink to "***class*** \`GeometricModels\`""></a></h3><hr><p><a href="https://docs.python.org/3/library/functions.html#staticmethod" target="_blank" rel="noreferrer"><code>@staticmethod</code></a></p><h4 id="method-sphere-radius-float-density-float" tabindex="-1"><em><strong>method</strong></em> <code>sphere(radius: float, density: float)</code> <a class="header-anchor" href="#method-sphere-radius-float-density-float" aria-label="Permalink to "***method*** \`sphere(radius: float, density: float)\`""></a></h4><p><strong>Description</strong>: 生成球体上的点集。</p><p><strong>Arguments</strong>:</p><blockquote><ul><li>radius:</li><li>density:</li></ul></blockquote><p><strong>Return</strong>: List[Point3]: 球体上的点集。</p><details><summary><b>Source code</b> or <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/presets/model/__init__.py#L12" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sphere</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(radius: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, density: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 4</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> density)</span></span>
|
||||
@ -7,4 +7,4 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(theta_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(theta_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(phi_list)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details>`,10),e=[n];function l(p,k,r,d,E,o){return a(),i("div",null,e)}const c=s(h,[["render",l]]);export{y as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details>`,11),e=[n];function l(p,k,r,d,E,o){return a(),i("div",null,e)}const c=s(h,[["render",l]]);export{y as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),h={name:"en/api/presets/model/index.md"},n=t("",10),e=[n];function l(p,k,r,d,E,o){return a(),i("div",null,e)}const c=s(h,[["render",l]]);export{y as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const y=JSON.parse('{"title":"mbcp.presets.model","description":"","frontmatter":{"title":"mbcp.presets.model","lastUpdated":false,"collapsed":true},"headers":[],"relativePath":"en/api/presets/model/index.md","filePath":"en/api/presets/model/index.md"}'),h={name:"en/api/presets/model/index.md"},n=t("",11),e=[n];function l(p,k,r,d,E,o){return a(),i("div",null,e)}const c=s(h,[["render",l]]);export{y as __pageData,c as default};
|
1
assets/ja_api_mp_math_angle.md.BDeXuTGl.js
Normal file
1
assets/ja_api_mp_math_angle.md.BDeXuTGl.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as a,o as i,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),e={name:"ja/api/mp_math/angle.md"},n=t("",80),h=[n];function l(p,k,r,o,d,g){return i(),a("div",null,h)}const c=s(e,[["render",l]]);export{m as __pageData,c as default};
|
||||
import{_ as s,c as a,o as i,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.angle","description":"","frontmatter":{"title":"mbcp.mp_math.angle","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/angle.md","filePath":"ja/api/mp_math/angle.md"}'),e={name:"ja/api/mp_math/angle.md"},n=t("",99),h=[n];function l(p,r,k,o,d,g){return i(),a("div",null,h)}const c=s(e,[["render",l]]);export{m as __pageData,c as default};
|
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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(`<h1 id="モジュール-mbcp-mp-math-equation" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-equation" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>説明</strong>: 曲线方程。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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(`<h1 id="モジュール-mbcp-mp-math-equation" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.equation</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-equation" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.equation\`""></a></h1><p>本模块定义了方程相关的类和函数以及一些常用的数学函数</p><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><hr><h4 id="method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)</code> <a class="header-anchor" href="#method-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc" aria-label="Permalink to "***method*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc)\`""></a></h4><p><strong>説明</strong>: 曲线方程。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): x函数</li><li>y_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): y函数</li><li>z_func (<a href="./mp_math_typing.html#var-onevarfunc"><code>OneVarFunc</code></a>): z函数</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L12" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>説明</strong>: 计算曲线上的点。</p><p><strong>引数</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>戻り値</strong>: 目标点</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><hr><h4 id="method-self-t-var-point3-tuple-point3" tabindex="-1"><em><strong>method</strong></em> <code>self () *t: Var => Point3 | tuple[Point3, ...]</code> <a class="header-anchor" href="#method-self-t-var-point3-tuple-point3" aria-label="Permalink to "***method*** \`self () *t: Var => Point3 | tuple[Point3, ...]\`""></a></h4><p><strong>説明</strong>: 计算曲线上的点。</p><p><strong>引数</strong>:</p><blockquote><ul><li>*t:</li><li>参数:</li></ul></blockquote><p><strong>戻り値</strong>: 目标点</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __call__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t: Var) -> Point3 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[Point3, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> len</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(t) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>説明</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>引数</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>戻り値</strong>: 偏导函数</p><p><strong>例外</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([Point3(x, y, z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x, y, z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> zip</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func(t), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func(t))])</span></span></code></pre></div></details><hr><h3 id="func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex="-1"><em><strong>func</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc</code> <a class="header-anchor" href="#func-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label="Permalink to "***func*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc\`""></a></h3><p><strong>説明</strong>: 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p>目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升</p></div><p><strong>引数</strong>:</p><blockquote><ul><li>func (<a href="./mp_math_typing.html#var-multivarsfunc"><code>MultiVarsFunc</code></a>): N元函数</li><li>var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</li><li>epsilon: 偏移量</li></ul></blockquote><p><strong>戻り値</strong>: 偏导函数</p><p><strong>例外</strong>:</p><blockquote><ul><li>ValueError 无效变量类型</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(var, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||
@ -24,4 +24,4 @@ import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high_order_partial_derivative_func</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,23),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,26),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.DpC1ZpOZ.js";const u=JSON.parse('{"title":"mbcp.mp_math.equation","description":"","frontmatter":{"title":"mbcp.mp_math.equation","lastUpdated":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("",26),h=[l];function p(e,k,r,E,d,g){return a(),i("div",null,h)}const o=s(t,[["render",p]]);export{u as __pageData,o as default};
|
12
assets/ja_api_mp_math_function.md.DvFtmM8H.js
Normal file
12
assets/ja_api_mp_math_function.md.DvFtmM8H.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as n,c as s,j as a,a as Q,a4 as t,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),T={name:"ja/api/mp_math/function.md"},e=t("",4),l={class:"tip custom-block github-alert"},h=a("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},p=t("",1),o=[p],m=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mi",null,"f"),a("mo",{stretchy:"false"},"("),a("mi",null,"x"),a("mo",null,","),a("mi",null,"y"),a("mo",null,","),a("mi",null,"z"),a("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=t("",1),u=[g],y=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mo",{stretchy:"false"},"("),a("msub",null,[a("mi",null,"x"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"y"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"z"),a("mn",null,"0")]),a("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"},_=t("",1),w=[_],x=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mi",{mathvariant:"normal"},"∇"),a("mi",null,"f"),a("mo",{stretchy:"false"},"("),a("msub",null,[a("mi",null,"x"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"y"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"z"),a("mn",null,"0")]),a("mo",{stretchy:"false"},")"),a("mo",null,"="),a("mrow",{"data-mjx-texclass":"INNER"},[a("mo",{"data-mjx-texclass":"OPEN"},"("),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"x")])]),a("mo",null,","),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"y")])]),a("mo",null,","),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"z")])]),a("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=t("",13);function L(H,F,M,v,D,Z){return i(),s("div",null,[e,a("div",l,[h,a("p",null,[Q("已知一个函数"),a("mjx-container",r,[(i(),s("svg",d,o)),m]),Q(",则其在点"),a("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),a("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
||||
import{_ as n,c as s,j as a,a as Q,a4 as t,o as i}from"./chunks/framework.DpC1ZpOZ.js";const V=JSON.parse('{"title":"mbcp.mp_math.function","description":"","frontmatter":{"title":"mbcp.mp_math.function","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/function.md","filePath":"ja/api/mp_math/function.md"}'),T={name:"ja/api/mp_math/function.md"},e=t("",5),l={class:"tip custom-block github-alert"},h=a("p",{class:"custom-block-title"},"TIP",-1),r={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},d={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"},p=t("",1),o=[p],m=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mi",null,"f"),a("mo",{stretchy:"false"},"("),a("mi",null,"x"),a("mo",null,","),a("mi",null,"y"),a("mo",null,","),a("mi",null,"z"),a("mo",{stretchy:"false"},")")])],-1),k={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},c={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"},g=t("",1),u=[g],y=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mo",{stretchy:"false"},"("),a("msub",null,[a("mi",null,"x"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"y"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"z"),a("mn",null,"0")]),a("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"},_=t("",1),w=[_],x=a("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"}},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[a("mi",{mathvariant:"normal"},"∇"),a("mi",null,"f"),a("mo",{stretchy:"false"},"("),a("msub",null,[a("mi",null,"x"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"y"),a("mn",null,"0")]),a("mo",null,","),a("msub",null,[a("mi",null,"z"),a("mn",null,"0")]),a("mo",{stretchy:"false"},")"),a("mo",null,"="),a("mrow",{"data-mjx-texclass":"INNER"},[a("mo",{"data-mjx-texclass":"OPEN"},"("),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"x")])]),a("mo",null,","),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"y")])]),a("mo",null,","),a("mfrac",null,[a("mrow",null,[a("mi",null,"∂"),a("mi",null,"f")]),a("mrow",null,[a("mi",null,"∂"),a("mi",null,"z")])]),a("mo",{"data-mjx-texclass":"CLOSE"},")")])])],-1),b=t("",14);function L(H,F,M,v,D,Z){return i(),s("div",null,[e,a("div",l,[h,a("p",null,[Q("已知一个函数"),a("mjx-container",r,[(i(),s("svg",d,o)),m]),Q(",则其在点"),a("mjx-container",k,[(i(),s("svg",c,u)),y]),Q("处的梯度向量为: "),a("mjx-container",E,[(i(),s("svg",f,w)),x])])]),b])}const A=n(T,[["render",L]]);export{V as __pageData,A as default};
|
File diff suppressed because one or more lines are too long
44
assets/ja_api_mp_math_line.md.Dr4fEidY.js
Normal file
44
assets/ja_api_mp_math_line.md.Dr4fEidY.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
87
assets/ja_api_mp_math_plane.md.Cc1EMdFC.js
Normal file
87
assets/ja_api_mp_math_plane.md.Cc1EMdFC.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
assets/ja_api_mp_math_point.md.dm5hc0SY.js
Normal file
1
assets/ja_api_mp_math_point.md.dm5hc0SY.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),e={name:"ja/api/mp_math/point.md"},h=t("",39),n=[h];function l(p,o,k,r,d,g){return a(),i("div",null,n)}const y=s(e,[["render",l]]);export{c as __pageData,y as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const c=JSON.parse('{"title":"mbcp.mp_math.point","description":"","frontmatter":{"title":"mbcp.mp_math.point","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/point.md","filePath":"ja/api/mp_math/point.md"}'),h={name:"ja/api/mp_math/point.md"},e=t("",46),n=[e];function l(p,o,k,r,d,g){return a(),i("div",null,n)}const y=s(h,[["render",l]]);export{c as __pageData,y as default};
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),n={name:"api/mp_math/segment.md"},h=t(`<h1 id="模块-mbcp-mp-math-segment" tabindex="-1"><strong>模块</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#模块-mbcp-mp-math-segment" aria-label="Permalink to "**模块** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>说明</strong>: 三维空间中的线段。</p><p><strong>参数</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),n={name:"ja/api/mp_math/segment.md"},h=t(`<h1 id="モジュール-mbcp-mp-math-segment" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.segment</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-segment" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.segment\`""></a></h1><p>本模块定义了三维空间中的线段类</p><h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><hr><h4 id="method-init-self-p1-point3-p2-point3" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, p1: Point3, p2: Point3)</code> <a class="header-anchor" href="#method-init-self-p1-point3-p2-point3" aria-label="Permalink to "***method*** \`__init__(self, p1: Point3, p2: Point3)\`""></a></h4><p><strong>説明</strong>: 三维空间中的线段。</p><p><strong>引数</strong>:</p><blockquote><ul><li>p1 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的一个端点</li><li>p2 (<a href="./point.html#class-point3"><code>Point3</code></a>): 线段的另一个端点</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/segment.py#L14" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p1</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> p2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '方向向量'</span></span>
|
||||
@ -6,4 +6,4 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '长度'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.length </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.length</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '中心点'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,8),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.midpoint </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Point3((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p1.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.p2.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,9),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),n={name:"ja/api/mp_math/segment.md"},h=t("",8),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/segment.md","filePath":"ja/api/mp_math/segment.md"}'),n={name:"ja/api/mp_math/segment.md"},h=t("",9),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};
|
@ -1,6 +1,6 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},n=t(`<h1 id="モジュール-mbcp-mp-math-utils" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.utils</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-utils" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.utils\`""></a></h1><p>本模块定义了一些常用的工具函数</p><h3 id="func-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>func</strong></em> <code>clamp(x: float, min_: float, max_: float) -> float</code> <a class="header-anchor" href="#func-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***func*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p><strong>説明</strong>: 区间限定函数</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 值</li><li>min_ (<code>float</code>): 最小值</li><li>max_ (<code>float</code>): 最大值</li></ul></blockquote><p><strong>戻り値</strong>: <code>float</code>: 限定在区间内的值</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L17" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> max</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x, max_), min_)</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><h4 id="method-init-self-value-realnumber" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#method-init-self-value-realnumber" aria-label="Permalink to "***method*** \`__init__(self, value: RealNumber)\`""></a></h4><p><strong>説明</strong>: 用于近似比较对象</p><p><strong>引数</strong>:</p><blockquote><ul><li>value (<a href="./mp_math_typing.html#realnumber"><code>RealNumber</code></a>): 实数</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L36" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><h4 id="method-self-other" tabindex="-1"><em><strong>method</strong></em> <code>self == other</code> <a class="header-anchor" href="#method-self-other" aria-label="Permalink to "***method*** \`self == other\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L44" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},n=t(`<h1 id="モジュール-mbcp-mp-math-utils" tabindex="-1"><strong>モジュール</strong> <code>mbcp.mp_math.utils</code> <a class="header-anchor" href="#モジュール-mbcp-mp-math-utils" aria-label="Permalink to "**モジュール** \`mbcp.mp_math.utils\`""></a></h1><p>本模块定义了一些常用的工具函数</p><hr><h3 id="func-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>func</strong></em> <code>clamp(x: float, min_: float, max_: float) -> float</code> <a class="header-anchor" href="#func-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***func*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p><strong>説明</strong>: 区间限定函数</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 值</li><li>min_ (<code>float</code>): 最小值</li><li>max_ (<code>float</code>): 最大值</li></ul></blockquote><p><strong>戻り値</strong>: <code>float</code>: 限定在区间内的值</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L17" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> max</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x, max_), min_)</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><hr><h4 id="method-init-self-value-realnumber" tabindex="-1"><em><strong>method</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#method-init-self-value-realnumber" aria-label="Permalink to "***method*** \`__init__(self, value: RealNumber)\`""></a></h4><p><strong>説明</strong>: 用于近似比较对象</p><p><strong>引数</strong>:</p><blockquote><ul><li>value (<a href="./mp_math_typing.html#realnumber"><code>RealNumber</code></a>): 实数</li></ul></blockquote><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L36" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><hr><h4 id="method-self-other" tabindex="-1"><em><strong>method</strong></em> <code>self == other</code> <a class="header-anchor" href="#method-self-other" aria-label="Permalink to "***method*** \`self == other\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L44" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> APPROX</span></span>
|
||||
@ -10,19 +10,19 @@ import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other, (Vector3, Point3, Plane3, Line3)):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> all</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.x, other.x), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.y, other.y), approx(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value.z, other.z)])</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span></code></pre></div></details><h4 id="method-raise-type-error-self-other" tabindex="-1"><em><strong>method</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#method-raise-type-error-self-other" aria-label="Permalink to "***method*** \`raise_type_error(self, other)\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L56" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h4 id="method-self-other-1" tabindex="-1"><em><strong>method</strong></em> <code>self != other</code> <a class="header-anchor" href="#method-self-other-1" aria-label="Permalink to "***method*** \`self != other\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L59" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __ne__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span></span></code></pre></div></details><h3 id="func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>func</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool</code> <a class="header-anchor" href="#func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to "***func*** \`approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool\`""></a></h3><p><strong>説明</strong>: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数1</li><li>y (<code>float</code>): 数2</li><li>epsilon (<code>float</code>): 误差</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>: 是否近似相等</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L63" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><h3 id="func-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>説明</strong>: 获取数的符号。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L76" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.raise_type_error(other)</span></span></code></pre></div></details><hr><h4 id="method-raise-type-error-self-other" tabindex="-1"><em><strong>method</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#method-raise-type-error-self-other" aria-label="Permalink to "***method*** \`raise_type_error(self, other)\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L56" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h4 id="method-self-other-1" tabindex="-1"><em><strong>method</strong></em> <code>self != other</code> <a class="header-anchor" href="#method-self-other-1" aria-label="Permalink to "***method*** \`self != other\`""></a></h4><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L59" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __ne__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__eq__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span></span></code></pre></div></details><hr><h3 id="func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>func</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool</code> <a class="header-anchor" href="#func-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to "***func*** \`approx(x: float, y: float = 0.0, epsilon: float = APPROX) -> bool\`""></a></h3><p><strong>説明</strong>: 判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数1</li><li>y (<code>float</code>): 数2</li><li>epsilon (<code>float</code>): 误差</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>: 是否近似相等</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L63" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><hr><h3 id="func-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>説明</strong>: 获取数的符号。</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L76" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '+'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '-'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><h3 id="func-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign_format(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign_format(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>説明</strong>: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L92" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="func-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>func</strong></em> <code>sign_format(x: float, only_neg: bool = False) -> str</code> <a class="header-anchor" href="#func-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to "***func*** \`sign_format(x: float, only_neg: bool = False) -> str\`""></a></h3><p><strong>説明</strong>: 格式化符号数 -1 -> -1 1 -> +1 0 -> ""</p><p><strong>引数</strong>:</p><blockquote><ul><li>x (<a href="https://docs.python.org/3/library/functions.html#float" target="_blank" rel="noreferrer"><code>float</code></a>): 数</li><li>only_neg (<a href="https://docs.python.org/3/library/functions.html#bool" target="_blank" rel="noreferrer"><code>bool</code></a>): 是否只返回负数的符号</li></ul></blockquote><p><strong>戻り値</strong>: <a href="https://docs.python.org/3/library/functions.html#str" target="_blank" rel="noreferrer"><code>str</code></a>: 符号 + - ""</p><details><summary><b>ソースコード</b> または <a href="https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/utils.py#L92" target="_blank">GitHubで表示</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details>`,38),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details>`,46),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},n=t("",38),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
||||
import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const E=JSON.parse('{"title":"mbcp.mp_math.utils","description":"","frontmatter":{"title":"mbcp.mp_math.utils","lastUpdated":false},"headers":[],"relativePath":"ja/api/mp_math/utils.md","filePath":"ja/api/mp_math/utils.md"}'),l={name:"ja/api/mp_math/utils.md"},n=t("",46),h=[n];function e(p,k,r,o,d,g){return a(),i("div",null,h)}const c=s(l,[["render",e]]);export{E as __pageData,c as default};
|
1
assets/ja_api_mp_math_vector.md.CCYTQMl1.js
Normal file
1
assets/ja_api_mp_math_vector.md.CCYTQMl1.js
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user