2024-08-28 12:03:02 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="zh-Hans" dir="ltr">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
2024-08-31 06:08:36 +08:00
|
|
|
<title>mbcp.mp_math.segment | MBCP 文档</title>
|
|
|
|
<meta name="description" content="MBCP 粒子计算和生成库文档">
|
2024-08-28 12:03:02 +08:00
|
|
|
<meta name="generator" content="VitePress v1.3.4">
|
2024-09-06 15:44:53 +08:00
|
|
|
<link rel="preload stylesheet" href="/assets/style.Czi07tLB.css" as="style">
|
2024-08-28 12:03:02 +08:00
|
|
|
|
2024-09-06 15:44:53 +08:00
|
|
|
<script type="module" src="/assets/app.BOTpTV4k.js"></script>
|
|
|
|
<link rel="modulepreload" href="/assets/chunks/theme.Uf1cjNk7.js">
|
2024-08-31 07:55:26 +08:00
|
|
|
<link rel="modulepreload" href="/assets/chunks/framework.DpC1ZpOZ.js">
|
2024-09-04 19:22:16 +08:00
|
|
|
<link rel="modulepreload" href="/assets/api_mp_math_segment.md.C2PEP6H5.lean.js">
|
2024-08-31 06:08:36 +08:00
|
|
|
<link rel="icon" type="image/svg+xml" href="/mbcp-logo.svg">
|
2024-08-31 07:31:49 +08:00
|
|
|
<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">
|
2024-08-28 12:03:02 +08:00
|
|
|
<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>
|
2024-09-04 19:22:16 +08:00
|
|
|
<div id="app"><div class="Layout" data-v-3b4648ff><!--[--><!--]--><!--[--><span tabindex="-1" data-v-e813112c></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-e813112c> Skip to content </a><!--]--><!----><header class="VPNav" data-v-3b4648ff data-v-e823d444><div class="VPNavBar has-sidebar top" data-v-e823d444 data-v-da0688be><div class="wrapper" data-v-da0688be><div class="container" data-v-da0688be><div class="title" data-v-da0688be><div class="VPNavBarTitle has-sidebar" data-v-da0688be data-v-606a7e0f><a class="title" href="/" data-v-606a7e0f><!--[--><!--]--><!--[--><img class="VPImage logo" src="/mbcp-logo.svg" alt data-v-cc63e071><!--]--><span data-v-606a7e0f>MBCP 文档</span><!--[--><!--]--></a></div></div><div class="content" data-v-da0688be><div class="content-body" data-v-da0688be><!--[--><!--]--><div class="VPNavBarSearch search" data-v-da0688be><!--[--><!----><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-da0688be data-v-bf53b681><span id="main-nav-aria-label" class="visually-hidden" data-v-bf53b681> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/guide/" tabindex="0" data-v-bf53b681 data-v-9a0da802><!--[--><span data-v-9a0da802>快速开始</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/refer.html" tabindex="0" data-v-bf53b681 data-v-9a0da802><!--[--><span data-v-9a0da802>参考</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/api/" tabindex="0" data-v-bf53b681 data-v-9a0da802><!--[--><span data-v-9a0da802>API引用</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/demo/" tabindex="0" data-v-bf53b681 data-v-9a0da802><!--[--><span data-v-9a0da802>实例</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-da0688be data-v-912817b1 data-v-00660109><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-00660109><span class="text" data-v-00660109><span class="vpi-languages option-icon" data-v-00660109></span><!----><span class="vpi-chevron-down text-icon" data-v-00660109></span></span></button><div class="menu" data-v-00660109><div class="VPMenu" data-v-00660109 data-v-809b8af7><!----><!--[--><!--[--><div class="items" data-v-912817b1><p class="title" data-v-912817b1>简体中文</p><!--[--><div class="VPMenuLink" data-v-912817b1 data-v-25a54821><a class="VPLink link" href="/en/api/mp_math/segment.html" data-v-25a54821><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-912817b1 data-v-25a54821><a class="VPLink link" href="/ja/api/mp_math/segment.html" data-v-25a54821><!--[-->日本語<!--]--></a></div><div class="VPMenuLink" data-v-912817b1 data-v-25a54821><a class="VPLink link" href="/zht/api/mp_math/segment.html" data-v-25a54821><!--[-->繁體中文<!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-da0688be data-v-864d2abc><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-864d2abc data-v-3125216b data-v-846fe538><span class="check" data-v-846fe538><span class="icon" data-v-846fe538><!--[--><span class="vpi-sun sun" data-v-3125216b></span><span class="vpi-moon moon" data-v-3125216b></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-da0688be data-v-2c606308 data-v-100434c4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/snowykami/mbcp" aria-label="github" target="_blank" re
|
2024-08-28 12:03:02 +08:00
|
|
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
|
|
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 三维空间中的线段。</span></span>
|
2024-08-31 09:34:37 +08:00
|
|
|
<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;"> p1 ([`Point3`](./point#class-point3)): 线段的一个端点</span></span>
|
|
|
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> p2 ([`Point3`](./point#class-point3)): 线段的另一个端点</span></span>
|
2024-08-28 12:03:02 +08:00
|
|
|
<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;">.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>
|
|
|
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction </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 </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;">.p1</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;">.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>
|
2024-09-03 22:49:39 +08:00
|
|
|
<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></div></div></main><footer class="VPDocFooter" data-v-01c90815 data-v-28deee4a><!--[--><!--]--><div class="edit-info" data-v-28deee4a><div class="edit-link" data-v-28deee4a><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/segment.py" target="_blank" rel="noreferrer" data-v-28deee4a><!--[--><span class="vpi-square-pen edit-link-icon" data-v-28deee4a></span> 在 GitHub 上编辑此页<!--]--></a></div><!----></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-28deee4a><span class="visually-hidden" id="doc-footer-aria-label" data-v-28deee4a>Pager</span><div class="pager" data-v-28deee4a><a class="VPLink link pager-link prev" href="/api/mp_math/point.html" data-v-28deee4a><!--[--><span class="desc" data-v-28deee4a>上一页</span><span class="title" data-v-28deee4a>mbcp.mp_math.point</span><!--]--></a></div><div class="pager" data-v-28deee4a><a class="VPLink link pager-link next" href="/api/mp_math/utils.html" data-v-28deee4a><!--[--><span class="desc" data-v-28deee4a>下一页</span><span class="title" data-v-28deee4a>mbcp.mp_math.utils</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-3b4648ff data-v-d69bcf5d><div class="container" data-v-d69bcf5d><p class="message" data-v-d69bcf5d>文档由 <a href="https://vitepress.dev/">VitePress</a> 构建 | API引用由 <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> 生成</p><p class="copyright" data-v-d69bcf5d>Copyright (C) 2020-2024 SnowyKami. All Rights Reserved</p></div></footer><!--[--><!--]--></div></div>
|
2024-09-06 15:44:53 +08:00
|
|
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api_index.md\":\"BO3OGCZm\",\"api_mp_math_angle.md\":\"DXjHPMcZ\",\"api_mp_math_const.md\":\"B_APaY-d\",\"api_mp_math_equation.md\":\"qaTLbds6\",\"api_mp_math_function.md\":\"D6Sk-jUO\",\"api_mp_math_index.md\":\"BfSAi6YB\",\"api_mp_math_line.md\":\"K-HhIsvU\",\"api_mp_math_mp_math_typing.md\":\"D0jHaHho\",\"api_mp_math_plane.md\":\"dDWoDJrS\",\"api_mp_math_point.md\":\"NLp_Sg9U\",\"api_mp_math_segment.md\":\"C2PEP6H5\",\"api_mp_math_utils.md\":\"QB0hGGMg\",\"api_mp_math_vector.md\":\"BzTv8qws\",\"api_particle_index.md\":\"BnaJlvrB\",\"api_presets_index.md\":\"Cn3tbiU4\",\"api_presets_model_index.md\":\"BH3azKA8\",\"demo_best-practice.md\":\"CmYjfrxd\",\"demo_index.md\":\"CVAdlaFI\",\"en_api_index.md\":\"C0-LRrMB\",\"en_api_mp_math_angle.md\":\"B5tdtBiM\",\"en_api_mp_math_const.md\":\"f-2wQHW5\",\"en_api_mp_math_equation.md\":\"N3oP-7Ua\",\"en_api_mp_math_function.md\":\"BT0NB_1n\",\"en_api_mp_math_index.md\":\"BiDCWhuz\",\"en_api_mp_math_line.md\":\"0bBpZMyn\",\"en_api_mp_math_mp_math_typing.md\":\"A2oAWINP\",\"en_api_mp_math_plane.md\":\"BqUredjB\",\"en_api_mp_math_point.md\":\"Ba_i7dDC\",\"en_api_mp_math_segment.md\":\"BhIGb9yq\",\"en_api_mp_math_utils.md\":\"Bz-xJhl3\",\"en_api_mp_math_vector.md\":\"OzaLDP6e\",\"en_api_particle_index.md\":\"j3_p5KtY\",\"en_api_presets_index.md\":\"Bj8HQN_s\",\"en_api_presets_model_index.md\":\"tRSLY10d\",\"en_demo_best-practice.md\":\"CmtY105n\",\"en_guide_index.md\":\"C3kI8f8A\",\"en_index.md\":\"Cc-Nt9Ot\",\"en_refer_index.md\":\"Cq6GWi0V\",\"guide_index.md\":\"CJOqvlSE\",\"index.md\":\"WVpbC1C1\",\"ja_api_index.md\":\"CGngNEPX\",\"ja_api_mp_math_angle.md\":\"BPpenAm_\",\"ja_api_mp_math_const.md\":\"kKAd6ihV\",\"ja_api_mp_math_equation.md\":\"Cxc2AyGq\",\"ja_api_mp_math_function.md\":\"zcK7s9-C\",\"ja_api_mp_math_index.md\":\"BCReRKfD\",\"ja_api_mp_math_line.md\":\"BUEG7Qno\",\"ja_api_mp_math_mp_math_typing.md\":\"CzEPV5Ep\",\"ja_api_mp_math_plane.md\":\"DmM6KUUe\",\"ja_api_mp_math_point.md\":\"Bj_wyaCj\",\"ja_api_mp_math_segment.md\":\"hBKUntDs\",\"ja_api_mp_math_utils.md\":\"DdrbPY-j\",\"ja_api_mp_math_vector.md\":\"DuAJ8ZJo\",\"ja_api_particle_index.md\":\"CW1rqarC\",\"ja_api_presets_index.md\":\"BFc_PfJb\",\"ja_api_presets_model_index.md\":\"BqEjZ7IY\",\"ja_demo_best-practice.md\":\"CBHiF6ec\",\"ja_guide_index.md\":\"w1Tf2Adm\",\"ja_index.md\":\"BvjV8RIJ\",\"ja_refer_index.md\":\"DamUscs8\",\"refer_7-differential-euqtion_index.md\":\"Dd2-7I9S\",\"refer_function_curry.md\":\"D_oqRDd3\",\"refer_function_function.md\":\"Bi_82lIJ\",\"refer_index.md\":\"yFZW0kI4\",\"zht_api_index.md\":\"Bh7ICG6U\",\"zht_api_mp_math_angle.md\":\"mmecNIJM\",\"zht_api_mp_math_const.md\":\"D9eBwcNw\",\"zht_api_mp_math_equation.md\":\"B00IWO_d\",\"zht_api_mp_math_function.md\":\"BnUerglv\",\"zht_api_mp_math_index.md\":\"DVqLRZhm\",\"zht_api_mp_math_line.md\":\"Dg3ji_dG\",\"zht_api_mp_math_mp_math_typing.md\":\"DWzRfFJe\",\"zht_api_mp_math_plane.md\":\"DHKntbKb\",\"zht_api_mp_math_point.md\":\"vFMEEeVu\",\"zht_api_mp_math_segment.md\":\"BuDHbwYP\",\"zht_api_mp_math_utils.md\":\"DvxTZy5j\",\"zht_api_mp_math_vector.md\":\"DoP7bI-7\",\"zht_api_particle_index.md\":\"bdouG1sk\",\"zht_api_presets_index.md\":\"9wdPAkKN\",\"zht_api_presets_model_index.md\":\"CyrJscBT\",\"zht_demo_best-practice.md\":\"CPNbD_Lg\",\"zht_guide_index.md\":\"BNnMViC8\",\"zht_index.md\":\"fkOYkZZe\",\"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\":\"mp_math\",\"it
|
2024-08-28 12:03:02 +08:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|