mbcp/ja/api/mp_math/utils.html

93 lines
66 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ja-JP" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>mbcp.mp_math.utils | MBCP ドキュメント</title>
<meta name="description" content="MBCP ライブラリ ドキュメント">
<meta name="generator" content="VitePress v1.3.4">
<link rel="preload stylesheet" href="/assets/style.UiSpMRXd.css" as="style">
<script type="module" src="/assets/app.B5ir6CFp.js"></script>
<link rel="modulepreload" href="/assets/chunks/theme.CIlXJY6j.js">
<link rel="modulepreload" href="/assets/chunks/framework.DpC1ZpOZ.js">
<link rel="modulepreload" href="/assets/ja_api_mp_math_utils.md.CrPKk6ui.lean.js">
<link rel="icon" type="image/svg+xml" href="/mbcp-logo.svg">
<link rel="stylesheet" href="https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i">
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-22f859ac><!--[--><!--]--><!--[--><span tabindex="-1" data-v-3e86afbf></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-3e86afbf> Skip to content </a><!--]--><!----><header class="VPNav" data-v-22f859ac data-v-2a4e514e><div class="VPNavBar has-sidebar top" data-v-2a4e514e data-v-1303e283><div class="wrapper" data-v-1303e283><div class="container" data-v-1303e283><div class="title" data-v-1303e283><div class="VPNavBarTitle has-sidebar" data-v-1303e283 data-v-10b95b50><a class="title" href="/ja/" data-v-10b95b50><!--[--><!--]--><!--[--><img class="VPImage logo" src="/mbcp-logo.svg" alt data-v-f925500d><!--]--><span data-v-10b95b50>MBCP ドキュメント</span><!--[--><!--]--></a></div></div><div class="content" data-v-1303e283><div class="content-body" data-v-1303e283><!--[--><!--]--><div class="VPNavBarSearch search" data-v-1303e283><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="検索を開く"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">検索</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-1303e283 data-v-0fb289c1><span id="main-nav-aria-label" class="visually-hidden" data-v-0fb289c1> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ja/guide/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>スタート</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ja/refer.html" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>リファレンス</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ja/api/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>APIリファレンス</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ja/demo/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>インスタンス</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-1303e283 data-v-cd7b67e8 data-v-ec8c49bc><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-ec8c49bc><span class="text" data-v-ec8c49bc><span class="vpi-languages option-icon" data-v-ec8c49bc></span><!----><span class="vpi-chevron-down text-icon" data-v-ec8c49bc></span></span></button><div class="menu" data-v-ec8c49bc><div class="VPMenu" data-v-ec8c49bc data-v-9990563e><!----><!--[--><!--[--><div class="items" data-v-cd7b67e8><p class="title" data-v-cd7b67e8>日本語</p><!--[--><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/api/mp_math/utils.html" data-v-79776a7a><!--[-->简体中文<!--]--></a></div><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/en/api/mp_math/utils.html" data-v-79776a7a><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/zht/api/mp_math/utils.html" data-v-79776a7a><!--[-->繁體中文<!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-1303e283 data-v-2a6692f8><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-2a6692f8 data-v-3a50aa5c data-v-d82e607b><span class="check" data-v-d82e607b><span class="icon" data-v-d82e607b><!--[--><span class="vpi-sun sun" data-v-3a50aa5c></span><span class="vpi-moon moon" data-v-3a50aa5c></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-1303e283 data-v-f3b91b3a data-v-fa18fe49><!--[--><a class="VPSocialLink no-icon" href="https://github.com/snowykami/mbcp" aria-label="github" target="_blank" rel="noopener" data-v-fa18fe49 data-v-b0526bd7><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-1303e283 data-v-2fc967b6 data-v-ec8c49bc><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-ec8c49bc><span class="vpi-more-horizontal icon" data-v-ec8c49bc></span></button><div class="menu" data-v-ec8c49bc><div class="VPMenu" data-v-ec8c49bc data-v-9990563e><!----><!--[--><!--[--><div class="group translations" data-v-2fc967b6><p class="trans-title" data-v-2fc967b6>日本語</p><!--[--><div class="VPMenuLink" data-v-2fc967b6 data-v-79776a7a><a class="VPLink link" href="/api/mp_math/utils.html" data-v-79776a7a><!--[-->简体中文<!--]--></a></div><div class="VPMenuLink" data-v-2fc967b6 data-v-79776a7a><a class="VPLink link" href="/en/api/mp_math/utils.html" data-v-79776a7a><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-2fc967b6 data-v-79776a7a><a class="VPLink link" href="/zht/api/mp_math/utils.html" data-v-79776a7a><!--[-->繁體中文<!--]--></a></div><!--]--></div><div class="group" data-v-2fc967b6><div class="item appearance" data-v-2fc967b6><p class="label" data-v-2fc967b6>Appearance</p><div class="appearance-action" data-v-2fc967b6><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-2fc967b6 data-v-3a50aa5c data-v-d82e607b><span class="check" data-v-d82e607b><span class="icon" data-v-d82e607b><!--[--><span class="vpi-sun sun" data-v-3a50aa5c></span><span class="vpi-moon moon" data-v-3a50aa5c></span><!--]--></span></span></button></div></div></div><div class="group" data-v-2fc967b6><div class="item social-links" data-v-2fc967b6><div class="VPSocialLinks social-links-list" data-v-2fc967b6 data-v-fa18fe49><!--[--><a class="VPSocialLink no-icon" href="https://github.com/snowykami/mbcp" aria-label="github" target="_blank" rel="noopener" data-v-fa18fe49 data-v-b0526bd7><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-1303e283 data-v-be64de2d><span class="container" data-v-be64de2d><span class="top" data-v-be64de2d></span><span class="middle" data-v-be64de2d></span><span class="bottom" data-v-be64de2d></span></span></button></div></div></div></div><div class="divider" data-v-1303e283><div class="divider-line" data-v-1303e283></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-22f859ac data-v-8af612ea><div class="container" data-v-8af612ea><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-8af612ea><span class="vpi-align-left menu-icon" data-v-8af612ea></span><span class="menu-text" data-v-8af612ea>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-8af612ea data-v-b418bf42><button data-v-b418bf42>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-22f859ac data-v-edd7de80><div class="curtain" data-v-edd7de80></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-edd7de80><span class="visually-hidden" id="sidebar-aria-label" data-v-edd7de80> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c3eaeb1a><section class="VPSidebarItem level-0 has-active" data-v-c3eaeb1a data-v-9035698b><div class="item" role="button" tabindex="0" data-v-9035698b><div class="indicator" data-v-9035698b></div><h2 class="text" data-v-9035698b>MBCP</h2><!----></div><div class="items" data-v-9035698b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/api.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible is-link has-active" data-v-9035698b data-v-9035698b><div class="item" tabindex="0" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/mp_math.html" data-v-9035698b><!--[--><h3 class="text" data-v-9035698b>mbcp.mp_math</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9035698b><span class="vpi-chevron-right caret-icon" data-v-9035698b></span></div></div><div class="items" data-v-9035698b><!--[--><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/angle.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.angle</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/const.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.const</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/equation.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.equation</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/function.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.function</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/line.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.line</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/mp_math_typing.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.mp_math_typing</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/plane.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.plane</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/point.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.point</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/segment.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.segment</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/utils.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.utils</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/mp_math/vector.html" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.mp_math.vector</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-9035698b data-v-9035698b><div class="item" tabindex="0" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/particle/particle.html" data-v-9035698b><!--[--><h3 class="text" data-v-9035698b>mbcp.particle</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9035698b><span class="vpi-chevron-right caret-icon" data-v-9035698b></span></div></div><div class="items" data-v-9035698b><!--[--><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/particle/" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.particle</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-9035698b data-v-9035698b><div class="item" tabindex="0" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/presets/presets.html" data-v-9035698b><!--[--><h3 class="text" data-v-9035698b>mbcp.presets</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9035698b><span class="vpi-chevron-right caret-icon" data-v-9035698b></span></div></div><div class="items" data-v-9035698b><!--[--><div class="VPSidebarItem level-2 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/presets/" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.presets</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-2 collapsible collapsed is-link" data-v-9035698b data-v-9035698b><div class="item" tabindex="0" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/presets/model/model.html" data-v-9035698b><!--[--><h4 class="text" data-v-9035698b>mbcp.presets.model</h4><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-9035698b><span class="vpi-chevron-right caret-icon" data-v-9035698b></span></div></div><div class="items" data-v-9035698b><!--[--><div class="VPSidebarItem level-3 is-link" data-v-9035698b data-v-9035698b><div class="item" data-v-9035698b><div class="indicator" data-v-9035698b></div><a class="VPLink link link" href="/ja/api/presets/model/" data-v-9035698b><!--[--><p class="text" data-v-9035698b>mbcp.presets.model</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-22f859ac data-v-ec7dbf3e><div class="VPDoc has-sidebar has-aside" data-v-ec7dbf3e data-v-40342069><!--[--><!--]--><div class="container" data-v-40342069><div class="aside" data-v-40342069><div class="aside-curtain" data-v-40342069></div><div class="aside-container" data-v-40342069><div class="aside-content" data-v-40342069><div class="VPDocAside" data-v-40342069 data-v-0ff3c77f><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-0ff3c77f data-v-e7b12e6e><div class="content" data-v-e7b12e6e><div class="outline-marker" data-v-e7b12e6e></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-e7b12e6e>ページの内容</div><ul class="VPDocOutlineItem root" data-v-e7b12e6e data-v-51c2c770><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-0ff3c77f></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-40342069><div class="content-container" data-v-40342069><!--[--><!--]--><main class="main" data-v-40342069><div style="position:relative;" class="vp-doc _ja_api_mp_math_utils" data-v-40342069><div><h1 id="mbcp-mp-math-utils" tabindex="-1">mbcp.mp_math.utils <a class="header-anchor" href="#mbcp-mp-math-utils" aria-label="Permalink to &quot;mbcp.mp_math.utils&quot;"></a></h1><p><strong>説明</strong>: 本模块定义了一些常用的工具函数</p><h3 id="def-clamp-x-float-min-float-max-float-float" tabindex="-1"><em><strong>def</strong></em> <code>clamp(x: float, min_: float, max_: float) -&gt; float</code> <a class="header-anchor" href="#def-clamp-x-float-min-float-max-float-float" aria-label="Permalink to &quot;***def*** `clamp(x: float, min_: float, max_: float) -&gt; float`&quot;"></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;">) -&gt; </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:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 区间限定函数</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Args:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x ([`float`](https://docs.python.org/3/library/functions.html#float)): 值</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> min_ (`float`): 最小值</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> max_ (`float`): 最大值</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Returns:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> `float`: 限定在区间内的值</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</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 &quot;***class*** `Approx`&quot;"></a></h3><h4 id="def-init-self-value-realnumber" tabindex="-1"><em><strong>def</strong></em> <code>__init__(self, value: RealNumber)</code> <a class="header-anchor" href="#def-init-self-value-realnumber" aria-label="Permalink to &quot;***def*** `__init__(self, value: RealNumber)`&quot;"></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:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 用于近似比较对象</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Args:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> value ([`RealNumber`](./mp_math_typing#realnumber)): 实数</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</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="def-eq-self-other" tabindex="-1"><em><strong>def</strong></em> <code>__eq__(self, other)</code> <a class="header-anchor" href="#def-eq-self-other" aria-label="Permalink to &quot;***def*** `__eq__(self, other)`&quot;"></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;">&lt;</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><h4 id="def-raise-type-error-self-other" tabindex="-1"><em><strong>def</strong></em> <code>raise_type_error(self, other)</code> <a class="header-anchor" href="#def-raise-type-error-self-other" aria-label="Permalink to &quot;***def*** `raise_type_error(self, other)`&quot;"></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;">&#39;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;">&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h4 id="def-ne-self-other" tabindex="-1"><em><strong>def</strong></em> <code>__ne__(self, other)</code> <a class="header-anchor" href="#def-ne-self-other" aria-label="Permalink to &quot;***def*** `__ne__(self, other)`&quot;"></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="def-approx-x-float-y-float-0-0-epsilon-float-approx-bool" tabindex="-1"><em><strong>def</strong></em> <code>approx(x: float, y: float = 0.0, epsilon: float = APPROX) -&gt; bool</code> <a class="header-anchor" href="#def-approx-x-float-y-float-0-0-epsilon-float-approx-bool" aria-label="Permalink to &quot;***def*** `approx(x: float, y: float = 0.0, epsilon: float = APPROX) -&gt; bool`&quot;"></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;">) -&gt; </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:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 判断两个数是否近似相等。或包装一个实数用于判断是否近似于0。</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Args:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x ([`float`](https://docs.python.org/3/library/functions.html#float)): 数1</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> y (`float`): 数2</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon (`float`): 误差</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Returns:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> [`bool`](https://docs.python.org/3/library/functions.html#bool): 是否近似相等</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</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;">&lt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><h3 id="def-sign-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>def</strong></em> <code>sign(x: float, only_neg: bool = False) -&gt; str</code> <a class="header-anchor" href="#def-sign-x-float-only-neg-bool-false-str" aria-label="Permalink to &quot;***def*** `sign(x: float, only_neg: bool = False) -&gt; str`&quot;"></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>: 符号 + - &quot;&quot;</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;">) -&gt; </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:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;获取数的符号。</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Args:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x ([`float`](https://docs.python.org/3/library/functions.html#float)): 数</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> only_neg ([`bool`](https://docs.python.org/3/library/functions.html#bool)): 是否只返回负数的符号</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Returns:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> [`str`](https://docs.python.org/3/library/functions.html#str): 符号 + - &quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</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;">&gt;</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;"> &#39;+&#39;</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;"> &#39;&#39;</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;">&lt;</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;"> &#39;-&#39;</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;"> &#39;&#39;</span></span></code></pre></div></details><h3 id="def-sign-format-x-float-only-neg-bool-false-str" tabindex="-1"><em><strong>def</strong></em> <code>sign_format(x: float, only_neg: bool = False) -&gt; str</code> <a class="header-anchor" href="#def-sign-format-x-float-only-neg-bool-false-str" aria-label="Permalink to &quot;***def*** `sign_format(x: float, only_neg: bool = False) -&gt; str`&quot;"></a></h3><p><strong>説明</strong>: 格式化符号数 -1 -&gt; -1 1 -&gt; +1 0 -&gt; &quot;&quot;</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>: 符号 + - &quot;&quot;</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;">) -&gt; </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:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;格式化符号数</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> -1 -&gt; -1</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 1 -&gt; +1</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 0 -&gt; &quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Args:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x ([`float`](https://docs.python.org/3/library/functions.html#float)): 数</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> only_neg ([`bool`](https://docs.python.org/3/library/functions.html#bool)): 是否只返回负数的符号</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Returns:</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> [`str`](https://docs.python.org/3/library/functions.html#str): 符号 + - &quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;&quot;</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;">&gt;</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;">&#39;+</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;">&#39;</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;">&#39;</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;">&#39;</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;">&lt;</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;">&#39;-</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;">&#39;</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;"> &#39;&#39;</span></span></code></pre></div></details></div></div></main><footer class="VPDocFooter" data-v-40342069 data-v-a4b38bd6><!--[--><!--]--><div class="edit-info" data-v-a4b38bd6><div class="edit-link" data-v-a4b38bd6><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/utils.py" target="_blank" rel="noreferrer" data-v-a4b38bd6><!--[--><span class="vpi-square-pen edit-link-icon" data-v-a4b38bd6></span> このページをGitHubで編集する<!--]--></a></div><!----></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-a4b38bd6><span class="visually-hidden" id="doc-footer-aria-label" data-v-a4b38bd6>Pager</span><div class="pager" data-v-a4b38bd6><a class="VPLink link pager-link prev" href="/ja/api/mp_math/segment.html" data-v-a4b38bd6><!--[--><span class="desc" data-v-a4b38bd6>前のページ</span><span class="title" data-v-a4b38bd6>mbcp.mp_math.segment</span><!--]--></a></div><div class="pager" data-v-a4b38bd6><a class="VPLink link pager-link next" href="/ja/api/mp_math/vector.html" data-v-a4b38bd6><!--[--><span class="desc" data-v-a4b38bd6>次のページ</span><span class="title" data-v-a4b38bd6>mbcp.mp_math.vector</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-22f859ac data-v-e3ca6860><div class="container" data-v-e3ca6860><p class="message" data-v-e3ca6860><a href="https://vitepress.dev/">VitePress</a> で構築されたドキュメント | <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> によって生成されたAPIリファレンス</p><p class="copyright" data-v-e3ca6860>Copyright (C) 2020-2024 SnowyKami. All Rights Reserved</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api_api.md\":\"cuvEYHFe\",\"api_index.md\":\"9xfR5bUd\",\"api_mp_math_angle.md\":\"3Na5IaYp\",\"api_mp_math_const.md\":\"O6cTulwX\",\"api_mp_math_equation.md\":\"z85zyCZL\",\"api_mp_math_function.md\":\"BhmJqpOo\",\"api_mp_math_index.md\":\"DHhPNV6R\",\"api_mp_math_line.md\":\"Dovi6bdM\",\"api_mp_math_mp_math.md\":\"mVabZTHd\",\"api_mp_math_mp_math_typing.md\":\"CEryCREV\",\"api_mp_math_plane.md\":\"Dv-GWbJg\",\"api_mp_math_point.md\":\"BvvrKTY8\",\"api_mp_math_segment.md\":\"_n__ViVt\",\"api_mp_math_utils.md\":\"kW3A-lG9\",\"api_mp_math_vector.md\":\"DvJcuPXW\",\"api_particle_index.md\":\"BxLVuqry\",\"api_particle_particle.md\":\"CioLG9Ab\",\"api_presets_index.md\":\"C7sBj6Q8\",\"api_presets_model_index.md\":\"F2zeh9P2\",\"api_presets_model_model.md\":\"BoocA59j\",\"api_presets_presets.md\":\"kIUJtfck\",\"demo_index.md\":\"CVAdlaFI\",\"en_api_api.md\":\"6DYwgQwO\",\"en_api_index.md\":\"D1elhNgk\",\"en_api_mp_math_angle.md\":\"09R7pxw_\",\"en_api_mp_math_const.md\":\"DjbxFoGO\",\"en_api_mp_math_equation.md\":\"DBXwIC0s\",\"en_api_mp_math_function.md\":\"nJ-E5W5r\",\"en_api_mp_math_index.md\":\"ypHGEnmb\",\"en_api_mp_math_line.md\":\"D0AfsxWD\",\"en_api_mp_math_mp_math.md\":\"5IisTIt3\",\"en_api_mp_math_mp_math_typing.md\":\"DWjztCj6\",\"en_api_mp_math_plane.md\":\"3xsZdWoR\",\"en_api_mp_math_point.md\":\"CxCgy181\",\"en_api_mp_math_segment.md\":\"BevquOvV\",\"en_api_mp_math_utils.md\":\"rVP-A71G\",\"en_api_mp_math_vector.md\":\"DMwD59YV\",\"en_api_particle_index.md\":\"NezC90nG\",\"en_api_particle_particle.md\":\"BTk7xB-d\",\"en_api_presets_index.md\":\"Clhg0YLX\",\"en_api_presets_model_index.md\":\"_hbR1U40\",\"en_api_presets_model_model.md\":\"B9FfcMgc\",\"en_api_presets_presets.md\":\"5pMosEdX\",\"en_guide_index.md\":\"C3kI8f8A\",\"en_index.md\":\"D5CddOW-\",\"en_refer_index.md\":\"Cq6GWi0V\",\"guide_index.md\":\"BVhQ0kPy\",\"index.md\":\"DJWBRkUz\",\"ja_api_api.md\":\"GOuCj9Bq\",\"ja_api_index.md\":\"DcZ9h1gI\",\"ja_api_mp_math_angle.md\":\"CAq1hHov\",\"ja_api_mp_math_const.md\":\"CACmM3Q4\",\"ja_api_mp_math_equation.md\":\"CwX1EUnA\",\"ja_api_mp_math_function.md\":\"BpyLWMmS\",\"ja_api_mp_math_index.md\":\"B_UDRWJp\",\"ja_api_mp_math_line.md\":\"BzytbSsM\",\"ja_api_mp_math_mp_math.md\":\"DGl-Yqoj\",\"ja_api_mp_math_mp_math_typing.md\":\"BANGfx9Q\",\"ja_api_mp_math_plane.md\":\"Bw6ecTDW\",\"ja_api_mp_math_point.md\":\"CFCWaCvm\",\"ja_api_mp_math_segment.md\":\"cuLLXTSO\",\"ja_api_mp_math_utils.md\":\"CrPKk6ui\",\"ja_api_mp_math_vector.md\":\"PFGJik39\",\"ja_api_particle_index.md\":\"SXvJHpqE\",\"ja_api_particle_particle.md\":\"DpDqAPA7\",\"ja_api_presets_index.md\":\"DrJ0aeZq\",\"ja_api_presets_model_index.md\":\"ub3RsBC9\",\"ja_api_presets_model_model.md\":\"Dw-6mfuk\",\"ja_api_presets_presets.md\":\"Bm4b0yEm\",\"ja_guide_index.md\":\"w1Tf2Adm\",\"ja_index.md\":\"DnsqZi7i\",\"ja_refer_index.md\":\"DamUscs8\",\"refer_function_curry.md\":\"D_oqRDd3\",\"refer_function_function.md\":\"Bi_82lIJ\",\"refer_index.md\":\"yFZW0kI4\",\"zht_api_api.md\":\"Ceti9rhA\",\"zht_api_index.md\":\"D2vE-hK0\",\"zht_api_mp_math_angle.md\":\"xBQ5jf2w\",\"zht_api_mp_math_const.md\":\"DhnGo46u\",\"zht_api_mp_math_equation.md\":\"CNqNdo8e\",\"zht_api_mp_math_function.md\":\"BYw-sqJL\",\"zht_api_mp_math_index.md\":\"C-ytwIT_\",\"zht_api_mp_math_line.md\":\"BKWlVJmv\",\"zht_api_mp_math_mp_math.md\":\"WAo96wsQ\",\"zht_api_mp_math_mp_math_typing.md\":\"2475K9x4\",\"zht_api_mp_math_plane.md\":\"Cbo0QRQD\",\"zht_api_mp_math_point.md\":\"Ci0RyJlm\",\"zht_api_mp_math_segment.md\":\"D_xbGo8n\",\"zht_api_mp_math_utils.md\":\"BsNVdUjt\",\"zht_api_mp_math_vector.md\":\"CelHQ_68\",\"zht_api_particle_index.md\":\"C8wv1sGB\",\"zht_api_particle_particle.md\":\"DLxDzJsb\",\"zht_api_presets_index.md\":\"CKWpXp08\",\"zht_api_presets_model_index.md\":\"a46BvX0I\",\"zht_api_presets_model_model.md\":\"C8PKDM2B\",\"zht_api_presets_presets.md\":\"nxuS_hT6\",\"zht_guide_index.md\":\"BNnMViC8\",\"zht_index.md\":\"CUR8-QXm\",\"zht_refer_index.md\":\"B7CQS2UW\"}");function deserializeFunctions(r){return Array.isArray(r)?r.map(deserializeFunctions):typeof r=="object"&&r!==null?Object.keys(r).reduce((t,n)=>(t[n]=deserializeFunctions(r[n]),t),{}):typeof r=="string"&&r.startsWith("_vp-fn_")?new Function(`return ${r.slice(7)}`)():r};window.__VP_SITE_DATA__=deserializeFunctions(JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"VitePress\",\"description\":\"A VitePress site\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"/mbcp-logo.svg\",\"sidebar\":{\"/api/\":{\"base\":\"/api/\",\"items\":[{\"text\":\"MBCP\",\"items\":[{\"text\":\"mbcp\",\"link\":\"api\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/mp_math\",\"items\":[{\"text\":\"mbcp.mp_math.angle\",\"link\":\"mp_math/angle\"},{\"text\":\"mbcp.mp_math.const\",\"link\":\"mp_math/const\"},{\"text\":\"mbcp.mp_math.equation\",\"link\":\"mp_math/equation\"},{\"text\":\"mbcp.mp_math.function\",\"link\":\"mp_math/function\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/\"},{\"text\":\"mbcp.mp_math.line\",\"link\":\"mp_math/line\"},{\"text\":\"mbcp.mp_math.mp_math_typing\",\"link\":\"mp_math/mp_math_typing\"},{\"text\":\"mbcp.mp_math.plane\",\"link\":\"mp_math/plane\"},{\"text\":\"mbcp.mp_math.point\",\"link\":\"mp_math/point\"},{\"text\":\"mbcp.mp_math.segment\",\"link\":\"mp_math/segment\"},{\"text\":\"mbcp.mp_math.utils\",\"link\":\"mp_math/utils\"},{\"text\":\"mbcp.mp_math.vector\",\"link\":\"mp_math/vector\"}],\"collapsed\":true},{\"text\":\"mbcp.particle\",\"link\":\"particle/particle\",\"items\":[{\"text\":\"mbcp.particle\",\"link\":\"particle/\"}],\"collapsed\":true},{\"text\":\"mbcp.presets\",\"link\":\"presets/presets\",\"items\":[{\"text\":\"mbcp.presets\",\"link\":\"presets/\"},{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/model\",\"items\":[{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/\"}],\"collapsed\":true}],\"collapsed\":true}]}]},\"/refer/\":{\"base\":\"/refer/\",\"items\":[{\"text\":\"MBCP\",\"items\":[{\"text\":\"函数\",\"link\":\"function/function\",\"items\":[{\"text\":\"柯里化\",\"link\":\"function/curry\"}],\"collapsed\":true}]}]},\"/guide/\":{\"base\":\"/guide/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/en/api/\":{\"base\":\"/en/api/\",\"items\":[{\"text\":\"MBCP\",\"items\":[{\"text\":\"mbcp\",\"link\":\"api\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/mp_math\",\"items\":[{\"text\":\"mbcp.mp_math.angle\",\"link\":\"mp_math/angle\"},{\"text\":\"mbcp.mp_math.const\",\"link\":\"mp_math/const\"},{\"text\":\"mbcp.mp_math.equation\",\"link\":\"mp_math/equation\"},{\"text\":\"mbcp.mp_math.function\",\"link\":\"mp_math/function\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/\"},{\"text\":\"mbcp.mp_math.line\",\"link\":\"mp_math/line\"},{\"text\":\"mbcp.mp_math.mp_math_typing\",\"link\":\"mp_math/mp_math_typing\"},{\"text\":\"mbcp.mp_math.plane\",\"link\":\"mp_math/plane\"},{\"text\":\"mbcp.mp_math.point\",\"link\":\"mp_math/point\"},{\"text\":\"mbcp.mp_math.segment\",\"link\":\"mp_math/segment\"},{\"text\":\"mbcp.mp_math.utils\",\"link\":\"mp_math/utils\"},{\"text\":\"mbcp.mp_math.vector\",\"link\":\"mp_math/vector\"}],\"collapsed\":true},{\"text\":\"mbcp.particle\",\"link\":\"particle/particle\",\"items\":[{\"text\":\"mbcp.particle\",\"link\":\"particle/\"}],\"collapsed\":true},{\"text\":\"mbcp.presets\",\"link\":\"presets/presets\",\"items\":[{\"text\":\"mbcp.presets\",\"link\":\"presets/\"},{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/model\",\"items\":[{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/\"}],\"collapsed\":true}],\"collapsed\":true}]}]},\"/en/refer/\":{\"base\":\"/en/refer/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/en/guide/\":{\"base\":\"/en/guide/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/ja/api/\":{\"base\":\"/ja/api/\",\"items\":[{\"text\":\"MBCP\",\"items\":[{\"text\":\"mbcp\",\"link\":\"api\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/mp_math\",\"items\":[{\"text\":\"mbcp.mp_math.angle\",\"link\":\"mp_math/angle\"},{\"text\":\"mbcp.mp_math.const\",\"link\":\"mp_math/const\"},{\"text\":\"mbcp.mp_math.equation\",\"link\":\"mp_math/equation\"},{\"text\":\"mbcp.mp_math.function\",\"link\":\"mp_math/function\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/\"},{\"text\":\"mbcp.mp_math.line\",\"link\":\"mp_math/line\"},{\"text\":\"mbcp.mp_math.mp_math_typing\",\"link\":\"mp_math/mp_math_typing\"},{\"text\":\"mbcp.mp_math.plane\",\"link\":\"mp_math/plane\"},{\"text\":\"mbcp.mp_math.point\",\"link\":\"mp_math/point\"},{\"text\":\"mbcp.mp_math.segment\",\"link\":\"mp_math/segment\"},{\"text\":\"mbcp.mp_math.utils\",\"link\":\"mp_math/utils\"},{\"text\":\"mbcp.mp_math.vector\",\"link\":\"mp_math/vector\"}],\"collapsed\":true},{\"text\":\"mbcp.particle\",\"link\":\"particle/particle\",\"items\":[{\"text\":\"mbcp.particle\",\"link\":\"particle/\"}],\"collapsed\":true},{\"text\":\"mbcp.presets\",\"link\":\"presets/presets\",\"items\":[{\"text\":\"mbcp.presets\",\"link\":\"presets/\"},{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/model\",\"items\":[{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/\"}],\"collapsed\":true}],\"collapsed\":true}]}]},\"/ja/refer/\":{\"base\":\"/ja/refer/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/ja/guide/\":{\"base\":\"/ja/guide/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/zht/api/\":{\"base\":\"/zht/api/\",\"items\":[{\"text\":\"MBCP\",\"items\":[{\"text\":\"mbcp\",\"link\":\"api\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/mp_math\",\"items\":[{\"text\":\"mbcp.mp_math.angle\",\"link\":\"mp_math/angle\"},{\"text\":\"mbcp.mp_math.const\",\"link\":\"mp_math/const\"},{\"text\":\"mbcp.mp_math.equation\",\"link\":\"mp_math/equation\"},{\"text\":\"mbcp.mp_math.function\",\"link\":\"mp_math/function\"},{\"text\":\"mbcp.mp_math\",\"link\":\"mp_math/\"},{\"text\":\"mbcp.mp_math.line\",\"link\":\"mp_math/line\"},{\"text\":\"mbcp.mp_math.mp_math_typing\",\"link\":\"mp_math/mp_math_typing\"},{\"text\":\"mbcp.mp_math.plane\",\"link\":\"mp_math/plane\"},{\"text\":\"mbcp.mp_math.point\",\"link\":\"mp_math/point\"},{\"text\":\"mbcp.mp_math.segment\",\"link\":\"mp_math/segment\"},{\"text\":\"mbcp.mp_math.utils\",\"link\":\"mp_math/utils\"},{\"text\":\"mbcp.mp_math.vector\",\"link\":\"mp_math/vector\"}],\"collapsed\":true},{\"text\":\"mbcp.particle\",\"link\":\"particle/particle\",\"items\":[{\"text\":\"mbcp.particle\",\"link\":\"particle/\"}],\"collapsed\":true},{\"text\":\"mbcp.presets\",\"link\":\"presets/presets\",\"items\":[{\"text\":\"mbcp.presets\",\"link\":\"presets/\"},{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/model\",\"items\":[{\"text\":\"mbcp.presets.model\",\"link\":\"presets/model/\"}],\"collapsed\":true}],\"collapsed\":true}]}]},\"/zht/refer/\":{\"base\":\"/zht/refer/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]},\"/zht/guide/\":{\"base\":\"/zht/guide/\",\"items\":[{\"text\":\"MBCP\",\"items\":[]}]}},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/snowykami/mbcp\"}],\"search\":{\"provider\":\"local\",\"options\":{\"locales\":{\"root\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"打开搜索框\"},\"modal\":{\"noResultsText\":\"没有找到搜索结果\",\"resetButtonTitle\":\"清除查询条件\",\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\"}}}},\"en\":{\"translations\":{\"button\":{\"buttonText\":\"Search\",\"buttonAriaLabel\":\"Search\"},\"modal\":{\"noResultsText\":\"No results found\",\"resetButtonTitle\":\"Reset search query\",\"footer\":{\"selectText\":\"Select\",\"navigateText\":\"Navigate\"}}}},\"zht\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文檔\",\"buttonAriaLabel\":\"打開搜索框\"},\"modal\":{\"noResultsText\":\"沒有找到搜索結果\",\"resetButtonTitle\":\"清除查詢條件\",\"footer\":{\"selectText\":\"選擇\",\"navigateText\":\"切換\"}}}},\"ja\":{\"translations\":{\"button\":{\"buttonText\":\"検索\",\"buttonAriaLabel\":\"検索を開く\"},\"modal\":{\"noResultsText\":\"検索結果が見つかりません\",\"resetButtonTitle\":\"リセット\",\"footer\":{\"selectText\":\"選択\",\"navigateText\":\"移動\"}}}}}}}},\"locales\":{\"root\":{\"label\":\"简体中文\",\"lang\":\"zh-Hans\",\"title\":\"MBCP 文档\",\"description\":\"MBCP 粒子计算和生成库文档\",\"themeConfig\":{\"nav\":[{\"text\":\"快速开始\",\"link\":\"/guide/\"},{\"text\":\"参考\",\"link\":\"/refer\"},{\"text\":\"API引用\",\"link\":\"/api/\"},{\"text\":\"实例\",\"link\":\"/demo/\"}],\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"editLink\":{\"pattern\":\"_vp-fn_({ filePath }) => {\\n const regex = /^[^\\\\/]+\\\\/api/;\\n if (regex.test(filePath)) {\\n filePath = filePath.replace(regex, \\\"\\\").replace(\\\"index.md\\\", \\\"__init__.py\\\").replace(\\\".md\\\", \\\".py\\\");\\n return `https://github.com/snowykami/mbcp/tree/main/mbcp/${filePath}`;\\n } else {\\n return `https://github.com/snowykami/mbcp/tree/main/docs/${filePath}`;\\n }\\n }\",\"text\":\"在 GitHub 上编辑此页\"},\"footer\":{\"message\":\"文档由 <a href=\\\"https://vitepress.dev/\\\">VitePress</a> 构建 | API引用由 <a href=\\\"https://github.com/LiteyukiStudio/litedoc\\\">litedoc</a> 生成\",\"copyright\":\"Copyright (C) 2020-2024 SnowyKami. All Rights Reserved\"},\"outline\":{\"label\":\"页面内容\",\"level\":[2,6]}}},\"en\":{\"label\":\"English\",\"lang\":\"en-US\",\"title\":\"MBCP docs\",\"description\":\"MBCP library docs\",\"themeConfig\":{\"nav\":[{\"text\":\"Get Start\",\"link\":\"/en/guide/\"},{\"text\":\"Reference\",\"link\":\"/en/refer\"},{\"text\":\"API Reference\",\"link\":\"/en/api/\"},{\"text\":\"Demo\",\"link\":\"/en/demo/\"}],\"docFooter\":{\"prev\":\"Prev Page\",\"next\":\"Next Page\"},\"editLink\":{\"pattern\":\"_vp-fn_({ filePath }) => {\\n const regex = /^[^\\\\/]+\\\\/api/;\\n if (regex.test(filePath)) {\\n filePath = filePath.replace(regex, \\\"\\\").replace(\\\"index.md\\\", \\\"__init__.py\\\").replace(\\\".md\\\", \\\".py\\\");\\n return `https://github.com/snowykami/mbcp/tree/main/mbcp/${filePath}`;\\n } else {\\n return `https://github.com/snowykami/mbcp/tree/main/docs/${filePath}`;\\n }\\n }\",\"text\":\"Edit this page on GitHub\"},\"footer\":{\"message\":\"Documentation built with <a href=\\\"https://vitepress.dev/\\\">VitePress</a> | API references generated by <a href=\\\"https://github.com/LiteyukiStudio/litedoc\\\">litedoc</a>\",\"copyright\":\"Copyright (C) 2020-2024 SnowyKami. All Rights Reserved\"},\"outline\":{\"label\":\"Page Content\",\"level\":[2,6]}}},\"ja\":{\"label\":\"日本語\",\"lang\":\"ja-JP\",\"title\":\"MBCP ドキュメント\",\"description\":\"MBCP ライブラリ ドキュメント\",\"themeConfig\":{\"nav\":[{\"text\":\"スタート\",\"link\":\"/ja/guide/\"},{\"text\":\"リファレンス\",\"link\":\"/ja/refer\"},{\"text\":\"APIリファレンス\",\"link\":\"/ja/api/\"},{\"text\":\"インスタンス\",\"link\":\"/ja/demo/\"}],\"docFooter\":{\"prev\":\"前のページ\",\"next\":\"次のページ\"},\"editLink\":{\"pattern\":\"_vp-fn_({ filePath }) => {\\n const regex = /^[^\\\\/]+\\\\/api/;\\n if (regex.test(filePath)) {\\n filePath = filePath.replace(regex, \\\"\\\").replace(\\\"index.md\\\", \\\"__init__.py\\\").replace(\\\".md\\\", \\\".py\\\");\\n return `https://github.com/snowykami/mbcp/tree/main/mbcp/${filePath}`;\\n } else {\\n return `https://github.com/snowykami/mbcp/tree/main/docs/${filePath}`;\\n }\\n }\",\"text\":\"このページをGitHubで編集する\"},\"footer\":{\"message\":\"<a href=\\\"https://vitepress.dev/\\\">VitePress</a> で構築されたドキュメント | <a href=\\\"https://github.com/LiteyukiStudio/litedoc\\\">litedoc</a> によって生成されたAPIリファレンス\",\"copyright\":\"Copyright (C) 2020-2024 SnowyKami. All Rights Reserved\"},\"outline\":{\"label\":\"ページの内容\",\"level\":[2,6]}}},\"zht\":{\"label\":\"繁體中文\",\"lang\":\"zh-Hant\",\"title\":\"MBCP 文檔\",\"description\":\"MBCP 粒子計算和生成庫文檔\",\"themeConfig\":{\"nav\":[{\"text\":\"指引\",\"link\":\"/zht/guide/\"},{\"text\":\"參考\",\"link\":\"/zht/refer\"},{\"text\":\"API引用\",\"link\":\"/zht/api/\"},{\"text\":\"示範\",\"link\":\"/zht/demo/\"}],\"docFooter\":{\"prev\":\"上一頁\",\"next\":\"下一頁\"},\"editLink\":{\"pattern\":\"_vp-fn_({ filePath }) => {\\n const regex = /^[^\\\\/]+\\\\/api/;\\n if (regex.test(filePath)) {\\n filePath = filePath.replace(regex, \\\"\\\").replace(\\\"index.md\\\", \\\"__init__.py\\\").replace(\\\".md\\\", \\\".py\\\");\\n return `https://github.com/snowykami/mbcp/tree/main/mbcp/${filePath}`;\\n } else {\\n return `https://github.com/snowykami/mbcp/tree/main/docs/${filePath}`;\\n }\\n }\",\"text\":\"於 GitHub 上編輯這頁\"},\"footer\":{\"message\":\"文檔由 <a href=\\\"https://vitepress.dev/\\\">VitePress</a> 構建 | API引用由 <a href=\\\"https://github.com/LiteyukiStudio/litedoc\\\">litedoc</a> 生成\",\"copyright\":\"Copyright (C) 2020-2024 SnowyKami. All Rights Reserved\"},\"outline\":{\"label\":\"頁面內容\",\"level\":[2,6]}}}},\"scrollOffset\":134,\"cleanUrls\":false}"));</script>
</body>
</html>