2024-08-28 20:35:22 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en-US" dir="ltr">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<title>mbcp.mp_math.segment | MBCP docs</title>
|
2024-08-31 06:08:36 +08:00
|
|
|
<meta name="description" content="MBCP library docs">
|
2024-08-28 20:35:22 +08:00
|
|
|
<meta name="generator" content="VitePress v1.3.4">
|
2024-08-31 06:08:36 +08:00
|
|
|
<link rel="preload stylesheet" href="/assets/style.BiH8pcAw.css" as="style">
|
2024-08-28 20:35:22 +08:00
|
|
|
|
2024-08-30 13:46:30 +08:00
|
|
|
<script type="module" src="/assets/app.DSCSdM_3.js"></script>
|
2024-08-28 20:35:22 +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">
|
2024-08-30 15:10:30 +08:00
|
|
|
<link rel="modulepreload" href="/assets/en_api_mp_math_segment.md.DMW-YUfw.lean.js">
|
2024-08-31 06:08:36 +08:00
|
|
|
<link rel="icon" type="image/svg+xml" href="/mbcp-logo.svg">
|
2024-08-28 20:35:22 +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-31 06:08:36 +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="/en/" data-v-10b95b50><!--[--><!--]--><!--[--><img class="VPImage logo" src="/mbcp-logo.svg" alt data-v-f925500d><!--]--><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="/en/guide/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>Get Start</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/refer.html" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>Reference</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/api/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>API Reference</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/demo/" tabindex="0" data-v-0fb289c1 data-v-ad4a8b64><!--[--><span data-v-ad4a8b64>Demo</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>English</p><!--[--><div class="VPMenuLink" data-v-cd7b67e8 data-v-79776a7a><a class="VPLink link" href="/api/mp_math/segment.html" data-v-79776a7a><!--[-->简体中文<!--]--></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-ec8c
|
2024-08-28 20:35:22 +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-31 06:08:36 +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="/en/api/mp_math/point.html" data-v-a4b38bd6><!--[--><span class="desc" data-v-a4b38bd6>Prev 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="/en/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>Documentation built with <a href="https://vitepress.dev/">VitePress</a> | API references generated by <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_api.md\":\"D_B0Hlcp\",\"api_index.md\":\"C_wESrrY\",\"api_mp_math_angle.md\":\"vKQLLqTS\",\"api_mp_math_const.md\":\"BAf8mK4W\",\"api_mp_math_equation.md\":\"B2FeM0MH\",\"api_mp_math_function.md\":\"BnSMoIoo\",\"api_mp_math_index.md\":\"BNf7bQqL\",\"api_mp_math_line.md\":\"DPWL9O-M\",\"api_mp_math_mp_math.md\":\"GlFMkWiQ\",\"api_mp_math_mp_math_typing.md\":\"DlnJmkos\",\"api_mp_math_plane.md\":\"DTAJAb0P\",\"api_mp_math_point.md\":\"vtgIded6\",\"api_mp_math_segment.md\":\"D-8aRB8W\",\"api_mp_math_utils.md\":\"DaaoR634\",\"api_mp_math_vector.md\":\"BTnPeAKR\",\"api_particle_index.md\":\"Cm3Vk-es\",\"api_particle_particle.md\":\"yD6tcNSr\",\"api_presets_index.md\":\"CD62I2gv\",\"api_presets_model_index.md\":\"gO0Notp6\",\"api_presets_model_model.md\":\"s8f68j_n\",\"api_presets_presets.md\":\"4R0VRbQo\",\"demo_index.md\":\"D-H9zRUE\",\"en_api_api.md\":\"BSgrCX1d\",\"en_api_index.md\":\"Dj_5nFTt\",\"en_api_mp_math_angle.md\":\"Bu07wjnV\",\"en_api_mp_math_const.md\":\"gGpXUShq\",\"en_api_mp_math_equation.md\":\"vEMIOITc\",\"en_api_mp_math_function.md\":\"BWhqj_9Y\",\"en_api_mp_math_index.md\":\"BEjLBMpH\",\"en_api_mp_math_line.md\":\"BGq09mco\",\"en_api_mp_math_mp_math.md\":\"D6ihYPav\",\"en_api_mp_math_mp_math_typing.md\":\"Dnl2aJQ4\",\"en_api_mp_math_plane.md\":\"C3KPGKE4\",\"en_api_mp_math_point.md\":\"D7ZdR7VM\",\"en_api_mp_math_segment.md\":\"DMW-YUfw\",\"en_api_mp_math_utils.md\":\"B3i5gz_2\",\"en_api_mp_math_vector.md\":\"CgtIoM4A\",\"en_api_particle_index.md\":\"BfyNQiRg\",\"en_api_particle_particle.md\":\"BNkfEyJn\",\"en_api_presets_index.md\":\"BWb2fpTg\",\"en_api_presets_model_index.md\":\"pbEu-669\",\"en_api_presets_model_model.md\":\"CL5uKZbj\",\"en_api_presets_presets.md\":\"CCUzsYog\",\"en_guide_index.md\":\"DrDHTYCZ\",\"en_index.md\":\"BSTSOH39\",\"en_refer_index.md\":\"alw4L-bp\",\"guide_index.md\":\"Cfmzk2IH\",\"index.md\":\"CNF8LJa0\",\"ja_api_api.md\":\"CPz58qIw\",\"ja_api_index.md\":\"CnUeuifx\",\"ja_api_mp_math_angle.md\":\"DTK1PNuJ\",\"ja_api_mp_math_const.md\":\"DGXAgDfn\",\"ja_api_mp_math_equation.md\":\"D-4BBsnQ\",\"ja_api_mp_math_function.md\":\"Bvf1U09A\",\"ja_api_mp_math_index.md\":\"CTZZ-p9Z\",\"ja_api_mp_math_line.md\":\"DYJV4KNE\",\"ja_api_mp_math_mp_math.md\":\"D-prC0UO\",\"ja_api_mp_math_mp_math_typing.md\":\"BNymgrCT\",\"ja_api_mp_math_plane.md\":\"D-yHaxP-\",\"ja_api_mp_math_point.md\":\"DjHRkHI5\",\"ja_api_mp_math_segment.md\":\"37V8kAc1\",\"ja_api_mp_math_utils.md\":\"BbdhM1tp\",\"ja_api_mp_math_vector.md\":\"BBVnCwJa\",\"ja_api_particle_index.md\":\"Jr41Y3TS\",\"ja_api_particle_particle.md\":\"exTt46pq\",\"ja_api_presets_index.md\":\"CQqdQbIZ\",\"ja_api_presets_model_index.md\":\"C-Ypf-qh\",\"ja_api_presets_model_model.md\":\"Dwbc1qIc\",\"ja_api_presets_presets.md\":\"DwzXdDqR\",\"ja_guide_index.md\":\"BxGnZYwR\",\"ja_index.md\":\"DCWiTENz\",\"ja_refer_index.md\":\"CODW6iMX\",\"refer_function_curry.md\":\"DwKZawp5\",\"refer_function_function.md\":\"D3IgfZX2\",\"refer_index.md\":\"CczYTl3j\",\"zht_api_api.md\":\"DyUSHA0S\",\"zht_api_index.md\":\"CgZH6aHQ\",\"zht_api_mp_math_angle.md\":\"lzcXwnW6\",\"zht_api_mp_math_const.md\":\"xwQvuYck\",\"zht_api_mp_math_equation.md\":\"BAr_ktNP\",\"zht_api_mp_math_function.md\":\"C2Gp7z0v\",\"zht_api_mp_math_index.md\":\"mmeMMriu\",\"zht_api_mp_math_line.md\":\"DX62bgjZ\",\"zht_api_mp_math_mp_math.md\":\"C302rxKc\",\"zht_api_mp_math_mp_math_typing.md\":\"CNiSnuMw\",\"zht_api_mp_math_plane.md\":\"DJ_9NQFz\",\"zht_api_mp_math_point.md\":\"D1nAiRP0\",\"zht_api_mp_math_segment.md\":\"CMRey-MG\",\"zht_api_mp_math_utils.md\":\"BDpW2Fd4\",\"zht_api_mp_math_vector.md\":\"DGVOQo3Y\",\"zht_api_particle_index.md\":\"8GaGB1ul\",\"zht_api_particle_particle.md\":\"huuRTEb9\",\"zht_api_presets_index.md\":\"DvOViSox\",\"zht_api_presets_model_index.md\":\"BJWX_k6K\",\"zht_api_presets_model_model.md\":\"CNI4ubOh\",\"zht_api_presets_presets.md\":\"CsDHjRbK\",\"zht_guide_index.md\":\"CsuFVFxu\",\"zht_index.md\":\"VMjJ0lpj\",\"zht_refer_index.md\":\"Bz6voxEQ\"}");function deserializeFunctions(r){return Array.isArray(r)
|
2024-08-28 20:35:22 +08:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|