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-28 20:35:22 +08:00
|
|
|
<title>mbcp.mp_math.segment | MBCP docs</title>
|
2024-08-28 12:03:02 +08:00
|
|
|
<meta name="description" content="一个用于Minecraft粒子计算和生成的库">
|
|
|
|
<meta name="generator" content="VitePress v1.3.4">
|
2024-08-30 13:46:30 +08:00
|
|
|
<link rel="preload stylesheet" href="/assets/style.CTLFORxu.css" as="style">
|
2024-08-28 12:03:02 +08:00
|
|
|
|
2024-08-30 13:46:30 +08:00
|
|
|
<script type="module" src="/assets/app.DSCSdM_3.js"></script>
|
2024-08-28 12:03:02 +08:00
|
|
|
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
2024-08-30 13:46:30 +08:00
|
|
|
<link rel="modulepreload" href="/assets/chunks/theme.CIS5wKR_.js">
|
|
|
|
<link rel="modulepreload" href="/assets/chunks/framework.C94oF1kp.js">
|
|
|
|
<link rel="modulepreload" href="/assets/api_mp_math_segment.md.BLQ-UFFk.lean.js">
|
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-08-30 13:46:30 +08:00
|
|
|
<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="/" data-v-10b95b50><!--[--><!--]--><!----><span data-v-10b95b50>MBCP docs</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><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="/guide/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>快速开始</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/api/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>API文档</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/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="/en/api/mp_math/segment.html" data-v-79776a7a><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/ja/api/mp_math/segment.html" data-v-79776a7a><!--[-->日本語<!--]--></a></div><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/zht/api/mp_math/segment.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 l
|
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>
|
|
|
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> :param p1:</span></span>
|
|
|
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> :param 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;">.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-08-30 13:46:30 +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-40342069 data-v-a4b38bd6><!--[--><!--]--><!----><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="/api/mp_math/point.html" data-v-a4b38bd6><!--[--><span class="desc" data-v-a4b38bd6>Previous page</span><span class="title" data-v-a4b38bd6>mbcp.mp_math.point</span><!--]--></a></div><div class="pager" data-v-a4b38bd6><a class="VPLink link pager-link next" href="/api/mp_math/utils.html" data-v-a4b38bd6><!--[--><span class="desc" data-v-a4b38bd6>Next page</span><span class="title" data-v-a4b38bd6>mbcp.mp_math.utils</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> 构建 | API引用由 <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> 生成</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_index.md\":\"CBQkxs7b\",\"api_mp_math_angle.md\":\"gd7UQvyy\",\"api_mp_math_const.md\":\"3scs0T6A\",\"api_mp_math_equation.md\":\"DuZ1hN4l\",\"api_mp_math_function.md\":\"U6hGSIm3\",\"api_mp_math_index.md\":\"1HMGGW3A\",\"api_mp_math_line.md\":\"B-ShajAF\",\"api_mp_math_mp_math_typing.md\":\"BtAkBFH3\",\"api_mp_math_plane.md\":\"DnJHiXsz\",\"api_mp_math_point.md\":\"9ZJsp3fx\",\"api_mp_math_segment.md\":\"BLQ-UFFk\",\"api_mp_math_utils.md\":\"yzrnwrbP\",\"api_mp_math_vector.md\":\"BSPllWFK\",\"api_particle_index.md\":\"Cgiljhcz\",\"api_presets_index.md\":\"RZipvyLz\",\"api_presets_model_index.md\":\"4RPSG4yh\",\"demo_index.md\":\"D-H9zRUE\",\"en_api_index.md\":\"BaqBYqY8\",\"en_api_mp_math_angle.md\":\"z39I-qRz\",\"en_api_mp_math_const.md\":\"CSc4Ut1v\",\"en_api_mp_math_equation.md\":\"0VnHCQQ4\",\"en_api_mp_math_function.md\":\"BzQ8FTPC\",\"en_api_mp_math_index.md\":\"Gx9tQ_Za\",\"en_api_mp_math_line.md\":\"e8dK90h_\",\"en_api_mp_math_mp_math_typing.md\":\"DByFpCMm\",\"en_api_mp_math_plane.md\":\"DYLAU1Re\",\"en_api_mp_math_point.md\":\"DYCVxK7m\",\"en_api_mp_math_segment.md\":\"CUQLS_qv\",\"en_api_mp_math_utils.md\":\"B4NFHkPz\",\"en_api_mp_math_vector.md\":\"BJF5J3QY\",\"en_api_particle_index.md\":\"f-q0HsfK\",\"en_api_presets_index.md\":\"CAyxYhKI\",\"en_api_presets_model_index.md\":\"DypEdCdE\",\"en_guide_index.md\":\"DrDHTYCZ\",\"en_index.md\":\"MCm69eyE\",\"guide_index.md\":\"NVx3l2Cr\",\"index.md\":\"BjJ9-kbE\",\"ja_api_index.md\":\"DW7hb-YH\",\"ja_api_mp_math_angle.md\":\"Cac0Crec\",\"ja_api_mp_math_const.md\":\"ClLsNkM_\",\"ja_api_mp_math_equation.md\":\"8i-WXc7A\",\"ja_api_mp_math_function.md\":\"GLsPZWha\",\"ja_api_mp_math_index.md\":\"BBAQ-AOT\",\"ja_api_mp_math_line.md\":\"BwZJXqnL\",\"ja_api_mp_math_mp_math_typing.md\":\"DHbmIzMT\",\"ja_api_mp_math_plane.md\":\"Ck5Q7igW\",\"ja_api_mp_math_point.md\":\"CbFZXfAJ\",\"ja_api_mp_math_segment.md\":\"DbTMeZAn\",\"ja_api_mp_math_utils.md\":\"D2dcQ_ET\",\"ja_api_mp_math_vector.md\":\"DBPPUIlc\",\"ja_api_particle_index.md\":\"C9QFJ8EN\",\"ja_api_presets_index.md\":\"BZKh7pEG\",\"ja_api_presets_model_index.md\":\"DzI-SA0H\",\"ja_guide_index.md\":\"BxGnZYwR\",\"ja_index.md\":\"CtozMsIU\",\"zht_api_index.md\":\"BoNToa7V\",\"zht_api_mp_math_angle.md\":\"B7iqArJr\",\"zht_api_mp_math_const.md\":\"3LY5TQ7t\",\"zht_api_mp_math_equation.md\":\"DMSjWdou\",\"zht_api_mp_math_function.md\":\"DOX7pGXC\",\"zht_api_mp_math_index.md\":\"Cp3ggfPO\",\"zht_api_mp_math_line.md\":\"D3xPFA2p\",\"zht_api_mp_math_mp_math_typing.md\":\"DTY2F-6g\",\"zht_api_mp_math_plane.md\":\"DAAO1c38\",\"zht_api_mp_math_point.md\":\"CK50W0JG\",\"zht_api_mp_math_segment.md\":\"BK0QQket\",\"zht_api_mp_math_utils.md\":\"BQrrPf8T\",\"zht_api_mp_math_vector.md\":\"CtYckwOL\",\"zht_api_particle_index.md\":\"CljeoVXn\",\"zht_api_presets_index.md\":\"DEbOKiST\",\"zht_api_presets_model_index.md\":\"3pGdZAT9\",\"zht_guide_index.md\":\"CsuFVFxu\",\"zht_index.md\":\"V9U3SwDR\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"MBCP docs\",\"description\":\"MBCP library docs\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"sidebar\":{\"/api/\":{\"base\":\"/api/\",\"items\":[{\"text\":\"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\
|
2024-08-28 12:03:02 +08:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|