mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-22 22:27:38 +08:00
Deploying to docs from @ snowykami/mbcp@f26d189ecd 🚀
This commit is contained in:
parent
deaa74b8b0
commit
2379329660
21
404.html
Normal file
21
404.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-Hans" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>404 | MBCP docs</title>
|
||||||
|
<meta name="description" content="Not Found">
|
||||||
|
<meta name="generator" content="VitePress v1.3.4">
|
||||||
|
<link rel="preload stylesheet" href="/assets/style.Bb0QBJmh.css" as="style">
|
||||||
|
|
||||||
|
<script type="module" src="/assets/app.l1Ut0uce.js"></script>
|
||||||
|
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
||||||
|
<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>
|
||||||
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api-ex.md\":\"DOsKaL8H\",\"api_index.md\":\"CsKClHFh\",\"api_mp_math_angle.md\":\"9eUTSIe4\",\"api_mp_math_const.md\":\"Bhz27OPg\",\"api_mp_math_equation.md\":\"xiyFVY1c\",\"api_mp_math_index.md\":\"DTIfeUA1\",\"api_mp_math_line.md\":\"BybnyRUL\",\"api_mp_math_mp_math_typing.md\":\"DXaadYgy\",\"api_mp_math_plane.md\":\"Cdj0PlKB\",\"api_mp_math_point.md\":\"D3f-vzVt\",\"api_mp_math_segment.md\":\"DIViBThe\",\"api_mp_math_utils.md\":\"CDwq4icO\",\"api_mp_math_vector.md\":\"BgK1TmFY\",\"api_particle_index.md\":\"BqH-w2FR\",\"api_presets_index.md\":\"CvgR5vOS\",\"api_presets_model_index.md\":\"D1iZ1qEr\",\"index.md\":\"CJvRmMfL\",\"md-ex.md\":\"BX0WqOqv\"}");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\":{\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/snowykami/mbcp\"}]},\"locales\":{\"root\":{\"label\":\"简体中文\",\"lang\":\"zh-Hans\",\"description\":\"一个用于Minecraft粒子计算和生成的库\",\"themeConfig\":{}},\"en\":{\"label\":\"English\",\"lang\":\"en-US\",\"description\":\"A library made for Minecraft particle generation\",\"themeConfig\":{}}},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
57
api-ex.html
Normal file
57
api-ex.html
Normal file
File diff suppressed because one or more lines are too long
24
api/index.html
Normal file
24
api/index.html
Normal file
File diff suppressed because one or more lines are too long
125
api/mp_math/angle.html
Normal file
125
api/mp_math/angle.html
Normal file
File diff suppressed because one or more lines are too long
24
api/mp_math/const.html
Normal file
24
api/mp_math/const.html
Normal file
File diff suppressed because one or more lines are too long
79
api/mp_math/equation.html
Normal file
79
api/mp_math/equation.html
Normal file
File diff suppressed because one or more lines are too long
24
api/mp_math/index.html
Normal file
24
api/mp_math/index.html
Normal file
File diff suppressed because one or more lines are too long
216
api/mp_math/line.html
Normal file
216
api/mp_math/line.html
Normal file
File diff suppressed because one or more lines are too long
24
api/mp_math/mp_math_typing.html
Normal file
24
api/mp_math/mp_math_typing.html
Normal file
File diff suppressed because one or more lines are too long
243
api/mp_math/plane.html
Normal file
243
api/mp_math/plane.html
Normal file
File diff suppressed because one or more lines are too long
53
api/mp_math/point.html
Normal file
53
api/mp_math/point.html
Normal file
File diff suppressed because one or more lines are too long
37
api/mp_math/segment.html
Normal file
37
api/mp_math/segment.html
Normal file
File diff suppressed because one or more lines are too long
97
api/mp_math/utils.html
Normal file
97
api/mp_math/utils.html
Normal file
File diff suppressed because one or more lines are too long
139
api/mp_math/vector.html
Normal file
139
api/mp_math/vector.html
Normal file
File diff suppressed because one or more lines are too long
24
api/particle/index.html
Normal file
24
api/particle/index.html
Normal file
File diff suppressed because one or more lines are too long
24
api/presets/index.html
Normal file
24
api/presets/index.html
Normal file
File diff suppressed because one or more lines are too long
66
api/presets/model/index.html
Normal file
66
api/presets/model/index.html
Normal file
File diff suppressed because one or more lines are too long
16
assets/api-ex.md.DOsKaL8H.js
Normal file
16
assets/api-ex.md.DOsKaL8H.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import{u as h,c as p,j as s,t as i,k as e,a2 as r,a,o as k}from"./chunks/framework.BV61Qrc0.js";const d=r(`<h1 id="runtime-api-examples" tabindex="-1">Runtime API Examples <a class="header-anchor" href="#runtime-api-examples" aria-label="Permalink to "Runtime API Examples""></a></h1><p>This page demonstrates usage of some of the runtime APIs provided by VitePress.</p><p>The main <code>useData()</code> API can be used to access site, theme, and page data for the current page. It works in both <code>.md</code> and <code>.vue</code> files:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">script</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setup</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { useData } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'vitepress'</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">theme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">frontmatter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">script</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-light-font-weight:bold;--shiki-dark-font-weight:bold;">## Results</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-light-font-weight:bold;--shiki-dark-font-weight:bold;">### Theme Data</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>{{ theme }}</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">### Page Data</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>{{ page }}</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">### Page Frontmatter</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>{{ frontmatter }}</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><h2 id="results" tabindex="-1">Results <a class="header-anchor" href="#results" aria-label="Permalink to "Results""></a></h2><h3 id="theme-data" tabindex="-1">Theme Data <a class="header-anchor" href="#theme-data" aria-label="Permalink to "Theme Data""></a></h3>`,6),o=s("h3",{id:"page-data",tabindex:"-1"},[a("Page Data "),s("a",{class:"header-anchor",href:"#page-data","aria-label":'Permalink to "Page Data"'},"")],-1),E=s("h3",{id:"page-frontmatter",tabindex:"-1"},[a("Page Frontmatter "),s("a",{class:"header-anchor",href:"#page-frontmatter","aria-label":'Permalink to "Page Frontmatter"'},"")],-1),g=s("h2",{id:"more",tabindex:"-1"},[a("More "),s("a",{class:"header-anchor",href:"#more","aria-label":'Permalink to "More"'},"")],-1),c=s("p",null,[a("Check out the documentation for the "),s("a",{href:"https://vitepress.dev/reference/runtime-api#usedata",target:"_blank",rel:"noreferrer"},"full list of runtime APIs"),a(".")],-1),D=JSON.parse('{"title":"Runtime API Examples","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"api-ex.md","filePath":"api-ex.md"}'),m={name:"api-ex.md"},F=Object.assign(m,{setup(u){const{site:y,theme:t,page:n,frontmatter:l}=h();return(_,f)=>(k(),p("div",null,[d,s("pre",null,i(e(t)),1),o,s("pre",null,i(e(n)),1),E,s("pre",null,i(e(l)),1),g,c]))}});export{D as __pageData,F as default};
|
1
assets/api-ex.md.DOsKaL8H.lean.js
Normal file
1
assets/api-ex.md.DOsKaL8H.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{u as h,c as p,j as s,t as i,k as e,a2 as r,a,o as k}from"./chunks/framework.BV61Qrc0.js";const d=r("",6),o=s("h3",{id:"page-data",tabindex:"-1"},[a("Page Data "),s("a",{class:"header-anchor",href:"#page-data","aria-label":'Permalink to "Page Data"'},"")],-1),E=s("h3",{id:"page-frontmatter",tabindex:"-1"},[a("Page Frontmatter "),s("a",{class:"header-anchor",href:"#page-frontmatter","aria-label":'Permalink to "Page Frontmatter"'},"")],-1),g=s("h2",{id:"more",tabindex:"-1"},[a("More "),s("a",{class:"header-anchor",href:"#more","aria-label":'Permalink to "More"'},"")],-1),c=s("p",null,[a("Check out the documentation for the "),s("a",{href:"https://vitepress.dev/reference/runtime-api#usedata",target:"_blank",rel:"noreferrer"},"full list of runtime APIs"),a(".")],-1),D=JSON.parse('{"title":"Runtime API Examples","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"api-ex.md","filePath":"api-ex.md"}'),m={name:"api-ex.md"},F=Object.assign(m,{setup(u){const{site:y,theme:t,page:n,frontmatter:l}=h();return(_,f)=>(k(),p("div",null,[d,s("pre",null,i(e(t)),1),o,s("pre",null,i(e(n)),1),E,s("pre",null,i(e(l)),1),g,c]))}});export{D as __pageData,F as default};
|
1
assets/api_index.md.CsKClHFh.js
Normal file
1
assets/api_index.md.CsKClHFh.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/index.md","filePath":"api/index.md"}'),a={name:"api/index.md"};function i(o,r,c,p,d,s){return n(),t("div")}const l=e(a,[["render",i]]);export{_ as __pageData,l as default};
|
1
assets/api_index.md.CsKClHFh.lean.js
Normal file
1
assets/api_index.md.CsKClHFh.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/index.md","filePath":"api/index.md"}'),a={name:"api/index.md"};function i(o,r,c,p,d,s){return n(),t("div")}const l=e(a,[["render",i]]);export{_ as __pageData,l as default};
|
102
assets/api_mp_math_angle.md.9eUTSIe4.js
Normal file
102
assets/api_mp_math_angle.md.9eUTSIe4.js
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
import{_ as s,c as a,o as i,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp\\\\nmath.angle","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.angle","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"api/mp_math/angle.md"}'),e={name:"api/mp_math/angle.md"},t=n(`<h3 id="class-anyangle" tabindex="-1"><em><strong>class</strong></em> <code>AnyAngle</code> <a class="header-anchor" href="#class-anyangle" aria-label="Permalink to "***class*** \`AnyAngle\`""></a></h3><h3 id="emsp-def-init-self-value-float-is-radian-bool-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, value: float, is_radian: bool) -> None</code> <a class="header-anchor" href="#emsp-def-init-self-value-float-is-radian-bool-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, value: float, is_radian: bool) -> None\`""></a></h3><p> 任意角度。</p><p>Args:</p><pre><code>value: 角度或弧度值
|
||||||
|
|
||||||
|
is_radian: 是否为弧度,默认为否
|
||||||
|
</code></pre><details><summary>源代码</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: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, is_radian: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> value: 角度或弧度值</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> is_radian: 是否为弧度,默认为否</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> is_radian:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</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;">.radian </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> PI</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 180</span></span></code></pre></div></details><h3 id="emsp-property" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-complementary-self-any-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>complementary(self: Any) -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-complementary-self-any-anyangle" aria-label="Permalink to "&emsp; ***def*** \`complementary(self: Any) -> 'AnyAngle'\`""></a></h3><p> 余角:两角的和为90°。</p><p>Returns:</p><pre><code>余角
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> complementary</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 余角:两角的和为90°。</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;"> 余角</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AnyAngle(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">PI</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</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;">.minimum_positive.radian, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">is_radian</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">True</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="emsp-property-1" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-1" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-supplementary-self-any-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>supplementary(self: Any) -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-supplementary-self-any-anyangle" aria-label="Permalink to "&emsp; ***def*** \`supplementary(self: Any) -> 'AnyAngle'\`""></a></h3><p> 补角:两角的和为180°。</p><p>Returns:</p><pre><code>补角
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> supplementary</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 补角:两角的和为180°。</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;"> 补角</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AnyAngle(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">PI</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;">.minimum_positive.radian, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">is_radian</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">True</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="emsp-property-2" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-2" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-degree-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>degree(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-degree-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`degree(self: Any) -> float\`""></a></h3><p> 角度。</p><p>Returns:</p><pre><code>弧度
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> degree</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 180</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> PI</span></span></code></pre></div></details><h3 id="emsp-property-3" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-3" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-minimum-positive-self-any-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>minimum_positive(self: Any) -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-minimum-positive-self-any-anyangle" aria-label="Permalink to "&emsp; ***def*** \`minimum_positive(self: Any) -> 'AnyAngle'\`""></a></h3><p> 最小正角。</p><p>Returns:</p><pre><code>最小正角度
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> minimum_positive</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 最小正角。</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;"> 最小正角度</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AnyAngle(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">%</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> PI</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span></code></pre></div></details><h3 id="emsp-property-4" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-4" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-maximum-negative-self-any-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>maximum_negative(self: Any) -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-maximum-negative-self-any-anyangle" aria-label="Permalink to "&emsp; ***def*** \`maximum_negative(self: Any) -> 'AnyAngle'\`""></a></h3><p> 最大负角。</p><p>Returns:</p><pre><code>最大负角度
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> maximum_negative</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 最大负角。</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;"> 最大负角度</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AnyAngle(</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;">.radian </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">%</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> PI</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">is_radian</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">True</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="emsp-property-5" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-5" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-sin-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>sin(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-sin-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`sin(self: Any) -> float\`""></a></h3><p> 正弦值。</p><p>Returns:</p><pre><code>正弦值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sin</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.sin(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details><h3 id="emsp-property-6" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-6" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-cos-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>cos(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-cos-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`cos(self: Any) -> float\`""></a></h3><p> 余弦值。</p><p>Returns:</p><pre><code>余弦值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cos</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.cos(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details><h3 id="emsp-property-7" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-7" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-tan-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>tan(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-tan-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`tan(self: Any) -> float\`""></a></h3><p> 正切值。</p><p>Returns:</p><pre><code>正切值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> tan</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.tan(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details><h3 id="emsp-property-8" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-8" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-cot-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>cot(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-cot-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`cot(self: Any) -> float\`""></a></h3><p> 余切值。</p><p>Returns:</p><pre><code>余切值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.tan(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details><h3 id="emsp-property-9" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-9" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-sec-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>sec(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-sec-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`sec(self: Any) -> float\`""></a></h3><p> 正割值。</p><p>Returns:</p><pre><code>正割值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sec</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.cos(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details><h3 id="emsp-property-10" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-10" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-csc-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>csc(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-csc-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`csc(self: Any) -> float\`""></a></h3><p> 余割值。</p><p>Returns:</p><pre><code>余割值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> csc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.sin(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.radian)</span></span></code></pre></div></details>`,72),p=[t];function l(h,k,r,d,o,y){return i(),a("div",null,p)}const c=s(e,[["render",l]]);export{F as __pageData,c as default};
|
1
assets/api_mp_math_angle.md.9eUTSIe4.lean.js
Normal file
1
assets/api_mp_math_angle.md.9eUTSIe4.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as a,o as i,a2 as n}from"./chunks/framework.BV61Qrc0.js";const F=JSON.parse('{"title":"mbcp.mp\\\\nmath.angle","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.angle","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/angle.md","filePath":"api/mp_math/angle.md"}'),e={name:"api/mp_math/angle.md"},t=n("",72),p=[t];function l(h,k,r,d,o,y){return i(),a("div",null,p)}const c=s(e,[["render",l]]);export{F as __pageData,c as default};
|
1
assets/api_mp_math_const.md.Bhz27OPg.js
Normal file
1
assets/api_mp_math_const.md.Bhz27OPg.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as a,c as e,o as t,a2 as r}from"./chunks/framework.BV61Qrc0.js";const v=JSON.parse('{"title":"mbcp.mp\\\\nmath.const","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.const","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/const.md","filePath":"api/mp_math/const.md"}'),o={name:"api/mp_math/const.md"},n=r('<h3 id="var-pi-math-pi" tabindex="-1"><em><strong>var</strong></em> <code>PI = math.pi</code> <a class="header-anchor" href="#var-pi-math-pi" aria-label="Permalink to "***var*** `PI = math.pi`""></a></h3><h3 id="var-e-math-e" tabindex="-1"><em><strong>var</strong></em> <code>E = math.e</code> <a class="header-anchor" href="#var-e-math-e" aria-label="Permalink to "***var*** `E = math.e`""></a></h3><h3 id="var-golden-ratio-1-math-sqrt-5-2" tabindex="-1"><em><strong>var</strong></em> <code>GOLDEN_RATIO = (1 + math.sqrt(5)) / 2</code> <a class="header-anchor" href="#var-golden-ratio-1-math-sqrt-5-2" aria-label="Permalink to "***var*** `GOLDEN_RATIO = (1 + math.sqrt(5)) / 2`""></a></h3><h3 id="var-gamma-0-5772156649015329" tabindex="-1"><em><strong>var</strong></em> <code>GAMMA = 0.5772156649015329</code> <a class="header-anchor" href="#var-gamma-0-5772156649015329" aria-label="Permalink to "***var*** `GAMMA = 0.5772156649015329`""></a></h3><h3 id="var-epsilon-0-0001" tabindex="-1"><em><strong>var</strong></em> <code>EPSILON = 0.0001</code> <a class="header-anchor" href="#var-epsilon-0-0001" aria-label="Permalink to "***var*** `EPSILON = 0.0001`""></a></h3><h3 id="var-approx-0-001" tabindex="-1"><em><strong>var</strong></em> <code>APPROX = 0.001</code> <a class="header-anchor" href="#var-approx-0-001" aria-label="Permalink to "***var*** `APPROX = 0.001`""></a></h3>',6),s=[n];function m(c,h,i,d,l,p){return t(),e("div",null,s)}const P=a(o,[["render",m]]);export{v as __pageData,P as default};
|
1
assets/api_mp_math_const.md.Bhz27OPg.lean.js
Normal file
1
assets/api_mp_math_const.md.Bhz27OPg.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as a,c as e,o as t,a2 as r}from"./chunks/framework.BV61Qrc0.js";const v=JSON.parse('{"title":"mbcp.mp\\\\nmath.const","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.const","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/const.md","filePath":"api/mp_math/const.md"}'),o={name:"api/mp_math/const.md"},n=r("",6),s=[n];function m(c,h,i,d,l,p){return t(),e("div",null,s)}const P=a(o,[["render",m]]);export{v as __pageData,P as default};
|
56
assets/api_mp_math_equation.md.xiyFVY1c.js
Normal file
56
assets/api_mp_math_equation.md.xiyFVY1c.js
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp\\\\nmath.equation","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.equation","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n(`<h3 id="def-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-multivarsfunc" tabindex="-1"><em><strong>def</strong></em> <code>get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number) -> MultiVarsFunc</code> <a class="header-anchor" href="#def-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-multivarsfunc" aria-label="Permalink to "***def*** \`get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number) -> MultiVarsFunc\`""></a></h3><p>求N元函数一阶偏导函数。这玩意不太稳定,慎用。</p><p>Args:</p><pre><code>func: 函数
|
||||||
|
|
||||||
|
var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)
|
||||||
|
|
||||||
|
epsilon: 偏移量
|
||||||
|
</code></pre><p>Returns:</p><pre><code>偏导函数
|
||||||
|
</code></pre><p>Raises:</p><pre><code>ValueError: 无效变量类型
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(func: MultiVarsFunc, var: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">], epsilon: Number</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">EPSILON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> MultiVarsFunc:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 求N元函数一阶偏导函数。这玩意不太稳定,慎用。</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;"> func: 函数</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon: 偏移量</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;"> 偏导函数</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Raises:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ValueError: 无效变量类型</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> isinstance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(var, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_plus </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(args)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_plus[var] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_minus </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(args)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_minus[var] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args_list_plus) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args_list_minus)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> partial_derivative_func</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;">(var, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">tuple</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> high_order_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> func</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> v </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> get_partial_derivative_func(result_func, v, epsilon)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high_order_partial_derivative_func</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Invalid var type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="def-partial-derivative-func-var" tabindex="-1"><em><strong>def</strong></em> <code>partial_derivative_func() -> Var</code> <a class="header-anchor" href="#def-partial-derivative-func-var" aria-label="Permalink to "***def*** \`partial_derivative_func() -> Var\`""></a></h3><details><summary>源代码</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;"> partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_plus </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(args)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_plus[var] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_minus </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(args)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args_list_minus[var] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args_list_plus) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args_list_minus)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon)</span></span></code></pre></div></details><h3 id="def-high-order-partial-derivative-func-var" tabindex="-1"><em><strong>def</strong></em> <code>high_order_partial_derivative_func() -> Var</code> <a class="header-anchor" href="#def-high-order-partial-derivative-func-var" aria-label="Permalink to "***def*** \`high_order_partial_derivative_func() -> Var\`""></a></h3><details><summary>源代码</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;"> high_order_partial_derivative_func</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args: Var) -> Var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> func</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> v </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> var:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> get_partial_derivative_func(result_func, v, epsilon)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_func(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args)</span></span></code></pre></div></details><h3 id="class-curveequation" tabindex="-1"><em><strong>class</strong></em> <code>CurveEquation</code> <a class="header-anchor" href="#class-curveequation" aria-label="Permalink to "***class*** \`CurveEquation\`""></a></h3><h3 id="emsp-def-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc) -> None</code> <a class="header-anchor" href="#emsp-def-init-self-x-func-onevarfunc-y-func-onevarfunc-z-func-onevarfunc-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc) -> None\`""></a></h3><p> 曲线方程。</p><p>:param x_func:</p><p>:param y_func:</p><p>:param z_func:</p><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x_func: OneVarFunc, y_func: OneVarFunc, z_func: OneVarFunc):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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 x_func:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> :param y_func:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> :param z_func:</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;">.x_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_func</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_func</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z_func </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_func</span></span></code></pre></div></details><h3 id="var-args-list-plus-list-args" tabindex="-1"><em><strong>var</strong></em> <code>args_list_plus = list(args)</code> <a class="header-anchor" href="#var-args-list-plus-list-args" aria-label="Permalink to "***var*** \`args_list_plus = list(args)\`""></a></h3><h3 id="var-args-list-minus-list-args" tabindex="-1"><em><strong>var</strong></em> <code>args_list_minus = list(args)</code> <a class="header-anchor" href="#var-args-list-minus-list-args" aria-label="Permalink to "***var*** \`args_list_minus = list(args)\`""></a></h3><h3 id="var-result-func-func" tabindex="-1"><em><strong>var</strong></em> <code>result_func = func</code> <a class="header-anchor" href="#var-result-func-func" aria-label="Permalink to "***var*** \`result_func = func\`""></a></h3><h3 id="var-result-func-get-partial-derivative-func-result-func-v-epsilon" tabindex="-1"><em><strong>var</strong></em> <code>result_func = get_partial_derivative_func(result_func, v, epsilon)</code> <a class="header-anchor" href="#var-result-func-get-partial-derivative-func-result-func-v-epsilon" aria-label="Permalink to "***var*** \`result_func = get_partial_derivative_func(result_func, v, epsilon)\`""></a></h3>`,24),e=[l];function h(p,k,r,d,E,g){return a(),i("div",null,e)}const o=s(t,[["render",h]]);export{u as __pageData,o as default};
|
1
assets/api_mp_math_equation.md.xiyFVY1c.lean.js
Normal file
1
assets/api_mp_math_equation.md.xiyFVY1c.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const u=JSON.parse('{"title":"mbcp.mp\\\\nmath.equation","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.equation","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/equation.md","filePath":"api/mp_math/equation.md"}'),t={name:"api/mp_math/equation.md"},l=n("",24),e=[l];function h(p,k,r,d,E,g){return a(),i("div",null,e)}const o=s(t,[["render",h]]);export{u as __pageData,o as default};
|
1
assets/api_mp_math_index.md.DTIfeUA1.js
Normal file
1
assets/api_mp_math_index.md.DTIfeUA1.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as t,c as e,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.mp\\\\nmath.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/index.md","filePath":"api/mp_math/index.md"}'),a={name:"api/mp_math/index.md"};function i(p,o,m,r,c,d){return n(),e("div")}const h=t(a,[["render",i]]);export{_ as __pageData,h as default};
|
1
assets/api_mp_math_index.md.DTIfeUA1.lean.js
Normal file
1
assets/api_mp_math_index.md.DTIfeUA1.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as t,c as e,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.mp\\\\nmath.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/index.md","filePath":"api/mp_math/index.md"}'),a={name:"api/mp_math/index.md"};function i(p,o,m,r,c,d){return n(),e("div")}const h=t(a,[["render",i]]);export{_ as __pageData,h as default};
|
193
assets/api_mp_math_line.md.BybnyRUL.js
Normal file
193
assets/api_mp_math_line.md.BybnyRUL.js
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const E=JSON.parse('{"title":"mbcp.mp\\\\nmath.line","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.line","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"api/mp_math/line.md"}'),e={name:"api/mp_math/line.md"},l=n(`<h3 id="class-line3" tabindex="-1"><em><strong>class</strong></em> <code>Line3</code> <a class="header-anchor" href="#class-line3" aria-label="Permalink to "***class*** \`Line3\`""></a></h3><h3 id="emsp-def-init-self-point-point3-direction-vector3-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, point: 'Point3', direction: 'Vector3') -> None</code> <a class="header-anchor" href="#emsp-def-init-self-point-point3-direction-vector3-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, point: 'Point3', direction: 'Vector3') -> None\`""></a></h3><p> 三维空间中的直线。由一个点和一个方向向量确定。</p><p>Args:</p><pre><code>point: 直线上的一点
|
||||||
|
|
||||||
|
direction: 直线的方向向量
|
||||||
|
</code></pre><details><summary>源代码</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, point: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, direction: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</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;"> 三维空间中的直线。由一个点和一个方向向量确定。</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;"> point: 直线上的一点</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> direction: 直线的方向向量</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;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> point</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:#24292E;--shiki-dark:#E1E4E8;"> direction</span></span></code></pre></div></details><h3 id="emsp-def-approx-self-other-line3-epsilon-float-bool" tabindex="-1"> <em><strong>def</strong></em> <code>approx(self, other: 'Line3', epsilon: float) -> bool</code> <a class="header-anchor" href="#emsp-def-approx-self-other-line3-epsilon-float-bool" aria-label="Permalink to "&emsp; ***def*** \`approx(self, other: 'Line3', epsilon: float) -> bool\`""></a></h3><p> 判断两条直线是否近似相等。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
|
||||||
|
epsilon: 误差
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似相等
|
||||||
|
</code></pre><details><summary>源代码</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;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一条直线</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon: 误差</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;"> 是否近似相等</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.is_approx_parallel(other, epsilon) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">and</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;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.point).is_approx_parallel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction, epsilon)</span></span></code></pre></div></details><h3 id="emsp-def-cal-angle-self-other-line3-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>cal_angle(self, other: 'Line3') -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-cal-angle-self-other-line3-anyangle" aria-label="Permalink to "&emsp; ***def*** \`cal_angle(self, other: 'Line3') -> 'AnyAngle'\`""></a></h3><p> 计算直线和直线之间的夹角。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
</code></pre><p>Returns:</p><pre><code>夹角弧度
|
||||||
|
</code></pre><p>Raises:</p><pre><code>TypeError: 不支持的类型
|
||||||
|
</code></pre><details><summary>源代码</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;"> cal_angle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 计算直线和直线之间的夹角。</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;"> other: 另一条直线</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;"> 夹角弧度</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Raises:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TypeError: 不支持的类型</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.cal_angle(other.direction)</span></span></code></pre></div></details><h3 id="emsp-def-cal-distance-self-other-line3-point3-float" tabindex="-1"> <em><strong>def</strong></em> <code>cal_distance(self, other: 'Line3 | Point3') -> float</code> <a class="header-anchor" href="#emsp-def-cal-distance-self-other-line3-point3-float" aria-label="Permalink to "&emsp; ***def*** \`cal_distance(self, other: 'Line3 | Point3') -> float\`""></a></h3><p> 计算直线和直线或点之间的距离。</p><p>Args:</p><pre><code>other: 平行直线或点
|
||||||
|
</code></pre><p>Returns:</p><pre><code>距离
|
||||||
|
</code></pre><p>Raises:</p><pre><code>TypeError: 不支持的类型
|
||||||
|
</code></pre><details><summary>源代码</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;"> cal_distance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3 | Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 平行直线或点</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;"> 距离</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Raises:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TypeError: 不支持的类型</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</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, Line3):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ==</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.is_parallel(other):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (other.point </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;">.point).cross(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction).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:#D73A49;--shiki-dark:#F97583;"> elif</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;">.is_coplanar(other):</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;">.direction.cross(other.direction) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">@</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;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.point) </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.cross(other.direction).length)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</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;">(other, Point3):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (other </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point).cross(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction).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:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="emsp-def-cal-intersection-self-other-line3-point3" tabindex="-1"> <em><strong>def</strong></em> <code>cal_intersection(self, other: 'Line3') -> 'Point3'</code> <a class="header-anchor" href="#emsp-def-cal-intersection-self-other-line3-point3" aria-label="Permalink to "&emsp; ***def*** \`cal_intersection(self, other: 'Line3') -> 'Point3'\`""></a></h3><p> 计算两条直线的交点。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
</code></pre><p>Returns:</p><pre><code>交点
|
||||||
|
</code></pre><p>Raises:</p><pre><code>ValueError: 直线平行
|
||||||
|
|
||||||
|
ValueError: 直线不共面
|
||||||
|
</code></pre><details><summary>源代码</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;"> cal_intersection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一条直线</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;"> 交点</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Raises:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ValueError: 直线平行</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ValueError: 直线不共面</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.is_parallel(other):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Lines are parallel and do not intersect.'</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:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.is_coplanar(other):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ValueError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Lines are not coplanar and do not intersect.'</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;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point </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.cross(other.direction) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">@</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.direction.cross(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.point) </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.cross(other.direction).length </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</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</span></span></code></pre></div></details><h3 id="emsp-def-cal-perpendicular-self-point-point3-line3" tabindex="-1"> <em><strong>def</strong></em> <code>cal_perpendicular(self, point: 'Point3') -> 'Line3'</code> <a class="header-anchor" href="#emsp-def-cal-perpendicular-self-point-point3-line3" aria-label="Permalink to "&emsp; ***def*** \`cal_perpendicular(self, point: 'Point3') -> 'Line3'\`""></a></h3><p> 计算直线经过指定点p的垂线。</p><p>Args:</p><pre><code>point: 指定点
|
||||||
|
</code></pre><p>Returns:</p><pre><code>垂线
|
||||||
|
</code></pre><details><summary>源代码</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;"> cal_perpendicular</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, point: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 计算直线经过指定点p的垂线。</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;"> point: 指定点</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;"> 垂线</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Line3(point, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.cross(point </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;">.point))</span></span></code></pre></div></details><h3 id="emsp-def-get-point-self-t-realnumber-point3" tabindex="-1"> <em><strong>def</strong></em> <code>get_point(self, t: RealNumber) -> 'Point3'</code> <a class="header-anchor" href="#emsp-def-get-point-self-t-realnumber-point3" aria-label="Permalink to "&emsp; ***def*** \`get_point(self, t: RealNumber) -> 'Point3'\`""></a></h3><p> 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。</p><p>Args:</p><pre><code>t: 参数t
|
||||||
|
</code></pre><p>Returns:</p><pre><code>点
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, t: RealNumber) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 获取直线上的点。同一条直线,但起始点和方向向量不同,则同一个t对应的点不同。</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;"> t: 参数t</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;"> 点</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction</span></span></code></pre></div></details><h3 id="emsp-def-get-parametric-equations-self-tuple-onesinglevarfunc-onesinglevarfunc-onesinglevarfunc" tabindex="-1"> <em><strong>def</strong></em> <code>get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]</code> <a class="header-anchor" href="#emsp-def-get-parametric-equations-self-tuple-onesinglevarfunc-onesinglevarfunc-onesinglevarfunc" aria-label="Permalink to "&emsp; ***def*** \`get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]\`""></a></h3><p> 获取直线的参数方程。</p><p>Returns:</p><pre><code>x(t), y(t), z(t)
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_parametric_equations</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:</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;"> 获取直线的参数方程。</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;"> x(t), y(t), z(t)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">lambda</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.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;">.direction.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">lambda</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.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;">.direction.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">lambda</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.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;">.direction.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> t)</span></span></code></pre></div></details><h3 id="emsp-def-is-approx-parallel-self-other-line3-epsilon-float-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_approx_parallel(self, other: 'Line3', epsilon: float) -> bool</code> <a class="header-anchor" href="#emsp-def-is-approx-parallel-self-other-line3-epsilon-float-bool" aria-label="Permalink to "&emsp; ***def*** \`is_approx_parallel(self, other: 'Line3', epsilon: float) -> bool\`""></a></h3><p> 判断两条直线是否近似平行。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
|
||||||
|
epsilon: 误差
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似平行
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_approx_parallel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</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;">1e-06</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一条直线</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon: 误差</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;"> 是否近似平行</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.is_approx_parallel(other.direction, epsilon)</span></span></code></pre></div></details><h3 id="emsp-def-is-parallel-self-other-line3-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_parallel(self, other: 'Line3') -> bool</code> <a class="header-anchor" href="#emsp-def-is-parallel-self-other-line3-bool" aria-label="Permalink to "&emsp; ***def*** \`is_parallel(self, other: 'Line3') -> bool\`""></a></h3><p> 判断两条直线是否平行。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否平行
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_parallel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一条直线</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;"> 是否平行</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.is_parallel(other.direction)</span></span></code></pre></div></details><h3 id="emsp-def-is-collinear-self-other-line3-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_collinear(self, other: 'Line3') -> bool</code> <a class="header-anchor" href="#emsp-def-is-collinear-self-other-line3-bool" aria-label="Permalink to "&emsp; ***def*** \`is_collinear(self, other: 'Line3') -> bool\`""></a></h3><p> 判断两条直线是否共线。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否共线
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_collinear</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一条直线</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;"> 是否共线</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.is_parallel(other) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">and</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;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.point).is_parallel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction)</span></span></code></pre></div></details><h3 id="emsp-def-is-point-on-self-point-point3-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_point_on(self, point: 'Point3') -> bool</code> <a class="header-anchor" href="#emsp-def-is-point-on-self-point-point3-bool" aria-label="Permalink to "&emsp; ***def*** \`is_point_on(self, point: 'Point3') -> bool\`""></a></h3><p> 判断点是否在直线上。</p><p>Args:</p><pre><code>point: 点
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否在直线上
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_point_on</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, point: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> point: 点</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;"> 是否在直线上</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (point </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;">.point).is_parallel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction)</span></span></code></pre></div></details><h3 id="emsp-def-is-coplanar-self-other-line3-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_coplanar(self, other: 'Line3') -> bool</code> <a class="header-anchor" href="#emsp-def-is-coplanar-self-other-line3-bool" aria-label="Permalink to "&emsp; ***def*** \`is_coplanar(self, other: 'Line3') -> bool\`""></a></h3><p> 判断两条直线是否共面。</p><p>充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。</p><p>Args:</p><pre><code>other: 另一条直线
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否共面
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_coplanar</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> 充要条件:两直线方向向量的叉乘与两直线上任意一点的向量的点积为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;"> other: 另一条直线</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;"> 是否共面</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.cross(other.direction) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">@</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;">.point </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.point) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span></code></pre></div></details><h3 id="emsp-def-simplify-self-none" tabindex="-1"> <em><strong>def</strong></em> <code>simplify(self) -> None</code> <a class="header-anchor" href="#emsp-def-simplify-self-none" aria-label="Permalink to "&emsp; ***def*** \`simplify(self) -> None\`""></a></h3><p> 简化直线方程,等价相等。</p><p>自体简化,不返回值。</p><p>按照可行性一次对x y z 化 0 处理,并对向量单位化</p><details><summary>源代码</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;"> simplify</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self):</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;"> 简化直线方程,等价相等。</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 自体简化,不返回值。</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 按照可行性一次对x y z 化 0 处理,并对向量单位化</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.normalize()</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.direction.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.point.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span></code></pre></div></details><h3 id="emsp-classmethod" tabindex="-1"> <em><strong>@classmethod</strong></em> <a class="header-anchor" href="#emsp-classmethod" aria-label="Permalink to "&emsp; ***@classmethod***""></a></h3><h3 id="emsp-def-from-two-points-cls-any-p1-point3-p2-point3-line3" tabindex="-1"> <em><strong>def</strong></em> <code>from_two_points(cls: Any, p1: 'Point3', p2: 'Point3') -> 'Line3'</code> <a class="header-anchor" href="#emsp-def-from-two-points-cls-any-p1-point3-p2-point3-line3" aria-label="Permalink to "&emsp; ***def*** \`from_two_points(cls: Any, p1: 'Point3', p2: 'Point3') -> 'Line3'\`""></a></h3><p> 工厂函数 由两点构造直线。</p><p>Args:</p><pre><code>p1: 点1
|
||||||
|
|
||||||
|
p2: 点2
|
||||||
|
</code></pre><p>Returns:</p><pre><code>直线
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">classmethod</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> from_two_points</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(cls, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Line3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 工厂函数 由两点构造直线。</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;"> p1: 点1</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> p2: 点2</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;"> 直线</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> direction </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</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;"> p1</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> cls</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(p1, direction)</span></span></code></pre></div></details><h3 id="var-direction-p2-p1" tabindex="-1"><em><strong>var</strong></em> <code>direction = p2 - p1</code> <a class="header-anchor" href="#var-direction-p2-p1" aria-label="Permalink to "***var*** \`direction = p2 - p1\`""></a></h3><h3 id="var-s-line3" tabindex="-1"><em><strong>var</strong></em> <code>s = 'Line3: '</code> <a class="header-anchor" href="#var-s-line3" aria-label="Permalink to "***var*** \`s = 'Line3: '\`""></a></h3>`,110),p=[l];function t(h,k,r,d,o,g){return a(),i("div",null,p)}const c=s(e,[["render",t]]);export{E as __pageData,c as default};
|
1
assets/api_mp_math_line.md.BybnyRUL.lean.js
Normal file
1
assets/api_mp_math_line.md.BybnyRUL.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const E=JSON.parse('{"title":"mbcp.mp\\\\nmath.line","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.line","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/line.md","filePath":"api/mp_math/line.md"}'),e={name:"api/mp_math/line.md"},l=n("",110),p=[l];function t(h,k,r,d,o,g){return a(),i("div",null,p)}const c=s(e,[["render",t]]);export{E as __pageData,c as default};
|
1
assets/api_mp_math_mp_math_typing.md.DXaadYgy.js
Normal file
1
assets/api_mp_math_mp_math_typing.md.DXaadYgy.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as a,c as r,o as e,a2 as t}from"./chunks/framework.BV61Qrc0.js";const b=JSON.parse('{"title":"mbcp.mp\\\\nmath.mp\\\\nmath\\\\ntyping","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.mp\\\\nmath\\\\ntyping","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/mp_math_typing.md","filePath":"api/mp_math/mp_math_typing.md"}'),n={name:"api/mp_math/mp_math_typing.md"},o=t('<h3 id="var-singlevar-typevar-singlevar-bound-number" tabindex="-1"><em><strong>var</strong></em> <code>SingleVar = TypeVar('SingleVar', bound=Number)</code> <a class="header-anchor" href="#var-singlevar-typevar-singlevar-bound-number" aria-label="Permalink to "***var*** `SingleVar = TypeVar('SingleVar', bound=Number)`""></a></h3><h3 id="var-arrayvar-typevar-arrayvar-bound-iterable-number" tabindex="-1"><em><strong>var</strong></em> <code>ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])</code> <a class="header-anchor" href="#var-arrayvar-typevar-arrayvar-bound-iterable-number" aria-label="Permalink to "***var*** `ArrayVar = TypeVar('ArrayVar', bound=Iterable[Number])`""></a></h3>',2),m=[o];function p(i,_,d,s,c,l){return e(),r("div",null,m)}const u=a(n,[["render",p]]);export{b as __pageData,u as default};
|
1
assets/api_mp_math_mp_math_typing.md.DXaadYgy.lean.js
Normal file
1
assets/api_mp_math_mp_math_typing.md.DXaadYgy.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as a,c as r,o as e,a2 as t}from"./chunks/framework.BV61Qrc0.js";const b=JSON.parse('{"title":"mbcp.mp\\\\nmath.mp\\\\nmath\\\\ntyping","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.mp\\\\nmath\\\\ntyping","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/mp_math_typing.md","filePath":"api/mp_math/mp_math_typing.md"}'),n={name:"api/mp_math/mp_math_typing.md"},o=t("",2),m=[o];function p(i,_,d,s,c,l){return e(),r("div",null,m)}const u=a(n,[["render",p]]);export{b as __pageData,u as default};
|
220
assets/api_mp_math_plane.md.Cdj0PlKB.js
Normal file
220
assets/api_mp_math_plane.md.Cdj0PlKB.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/api_mp_math_plane.md.Cdj0PlKB.lean.js
Normal file
1
assets/api_mp_math_plane.md.Cdj0PlKB.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.plane","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.plane","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/plane.md","filePath":"api/mp_math/plane.md"}'),l={name:"api/mp_math/plane.md"},h=n("",119),t=[h];function e(p,k,r,d,o,E){return a(),i("div",null,t)}const F=s(l,[["render",e]]);export{y as __pageData,F as default};
|
30
assets/api_mp_math_point.md.D3f-vzVt.js
Normal file
30
assets/api_mp_math_point.md.D3f-vzVt.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.point","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.point","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"api/mp_math/point.md"}'),t={name:"api/mp_math/point.md"},l=n(`<h3 id="class-point3" tabindex="-1"><em><strong>class</strong></em> <code>Point3</code> <a class="header-anchor" href="#class-point3" aria-label="Permalink to "***class*** \`Point3\`""></a></h3><h3 id="emsp-def-init-self-x-float-y-float-z-float-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, x: float, y: float, z: float) -> None</code> <a class="header-anchor" href="#emsp-def-init-self-x-float-y-float-z-float-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, x: float, y: float, z: float) -> None\`""></a></h3><p> 笛卡尔坐标系中的点。</p><p>Args:</p><pre><code>x: x 坐标
|
||||||
|
|
||||||
|
y: y 坐标
|
||||||
|
|
||||||
|
z: z 坐标
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x: </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:#24292E;--shiki-dark:#E1E4E8;">, z: </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;"> """</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: x 坐标</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> y: y 坐标</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> z: z 坐标</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;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z</span></span></code></pre></div></details><h3 id="emsp-def-approx-self-other-point3-epsilon-float-bool" tabindex="-1"> <em><strong>def</strong></em> <code>approx(self, other: 'Point3', epsilon: float) -> bool</code> <a class="header-anchor" href="#emsp-def-approx-self-other-point3-epsilon-float-bool" aria-label="Permalink to "&emsp; ***def*** \`approx(self, other: 'Point3', epsilon: float) -> bool\`""></a></h3><p> 判断两个点是否近似相等。</p><p>Args:</p><pre><code>other:
|
||||||
|
|
||||||
|
epsilon:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似相等
|
||||||
|
</code></pre><details><summary>源代码</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;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon:</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;"> 是否近似相等</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</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;">([</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;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon, </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;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon, </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;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon])</span></span></code></pre></div></details>`,13),p=[l];function h(e,k,o,r,d,E){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{y as __pageData,F as default};
|
1
assets/api_mp_math_point.md.D3f-vzVt.lean.js
Normal file
1
assets/api_mp_math_point.md.D3f-vzVt.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.point","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.point","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/point.md","filePath":"api/mp_math/point.md"}'),t={name:"api/mp_math/point.md"},l=n("",13),p=[l];function h(e,k,o,r,d,E){return a(),i("div",null,p)}const F=s(t,[["render",h]]);export{y as __pageData,F as default};
|
14
assets/api_mp_math_segment.md.DIViBThe.js
Normal file
14
assets/api_mp_math_segment.md.DIViBThe.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const o=JSON.parse('{"title":"mbcp.mp\\\\nmath.segment","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.segment","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n(`<h3 id="class-segment3" tabindex="-1"><em><strong>class</strong></em> <code>Segment3</code> <a class="header-anchor" href="#class-segment3" aria-label="Permalink to "***class*** \`Segment3\`""></a></h3><h3 id="emsp-def-init-self-p1-point3-p2-point3-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, p1: 'Point3', p2: 'Point3') -> None</code> <a class="header-anchor" href="#emsp-def-init-self-p1-point3-p2-point3-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, p1: 'Point3', p2: 'Point3') -> None\`""></a></h3><p> 三维空间中的线段。</p><p>:param p1:</p><p>:param p2:</p><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, p1: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, p2: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Point3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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>
|
||||||
|
<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>`,6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default};
|
1
assets/api_mp_math_segment.md.DIViBThe.lean.js
Normal file
1
assets/api_mp_math_segment.md.DIViBThe.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const o=JSON.parse('{"title":"mbcp.mp\\\\nmath.segment","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.segment","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"api/mp_math/segment.md"}'),t={name:"api/mp_math/segment.md"},p=n("",6),h=[p];function l(e,k,r,d,E,g){return a(),i("div",null,h)}const y=s(t,[["render",l]]);export{o as __pageData,y as default};
|
74
assets/api_mp_math_utils.md.CDwq4icO.js
Normal file
74
assets/api_mp_math_utils.md.CDwq4icO.js
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.utils","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.utils","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"api/mp_math/utils.md"}'),t={name:"api/mp_math/utils.md"},l=n(`<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) -> float</code> <a class="header-anchor" href="#def-clamp-x-float-min-float-max-float-float" aria-label="Permalink to "***def*** \`clamp(x: float, min_: float, max_: float) -> float\`""></a></h3><p>区间截断函数。</p><p>Args:</p><pre><code>x:
|
||||||
|
|
||||||
|
min_:
|
||||||
|
|
||||||
|
max_:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>限制后的值
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clamp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, min_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, max_: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> min_:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> max_:</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;"> 限制后的值</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</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="def-approx-x-float-y-float-epsilon-float-bool" tabindex="-1"><em><strong>def</strong></em> <code>approx(x: float, y: float, epsilon: float) -> bool</code> <a class="header-anchor" href="#def-approx-x-float-y-float-epsilon-float-bool" aria-label="Permalink to "***def*** \`approx(x: float, y: float, epsilon: float) -> bool\`""></a></h3><p>判断两个数是否近似相等。或包装一个实数,用于判断是否近似于0。</p><p>Args:</p><pre><code>x:
|
||||||
|
|
||||||
|
y:
|
||||||
|
|
||||||
|
epsilon:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似相等
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> approx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</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:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> y:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon:</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;"> 是否近似相等</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><h3 id="def-sign-x-float-only-neg-bool-str" tabindex="-1"><em><strong>def</strong></em> <code>sign(x: float, only_neg: bool) -> str</code> <a class="header-anchor" href="#def-sign-x-float-only-neg-bool-str" aria-label="Permalink to "***def*** \`sign(x: float, only_neg: bool) -> str\`""></a></h3><p>获取数的符号。</p><p>Args:</p><pre><code>x: 数
|
||||||
|
|
||||||
|
only_neg: 是否只返回负数的符号
|
||||||
|
</code></pre><p>Returns:</p><pre><code>符号 + - ""
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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: 数</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> only_neg: 是否只返回负数的符号</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;"> 符号 + - ""</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '+'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '-'</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><h3 id="def-sign-format-x-float-only-neg-bool-str" tabindex="-1"><em><strong>def</strong></em> <code>sign_format(x: float, only_neg: bool) -> str</code> <a class="header-anchor" href="#def-sign-format-x-float-only-neg-bool-str" aria-label="Permalink to "***def*** \`sign_format(x: float, only_neg: bool) -> str\`""></a></h3><p>格式化符号数</p><p>-1 -> -1</p><p>1 -> +1</p><p>0 -> ""</p><p>Args:</p><pre><code>x: 数
|
||||||
|
|
||||||
|
only_neg: 是否只返回负数的符号
|
||||||
|
</code></pre><p>Returns:</p><pre><code>符号 + - ""
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sign_format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, only_neg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">False</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """格式化符号数</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> -1 -> -1</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 1 -> +1</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: 数</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> only_neg: 是否只返回负数的符号</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;"> 符号 + - ""</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> only_neg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> elif</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{abs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(x)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><h3 id="class-approx" tabindex="-1"><em><strong>class</strong></em> <code>Approx</code> <a class="header-anchor" href="#class-approx" aria-label="Permalink to "***class*** \`Approx\`""></a></h3><p>用于近似比较对象</p><p>已实现对象 实数 Vector3 Point3 Plane3 Line3</p><h3 id="emsp-def-init-self-value-realnumber-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, value: RealNumber) -> None</code> <a class="header-anchor" href="#emsp-def-init-self-value-realnumber-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, value: RealNumber) -> None\`""></a></h3><p> </p><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, value: RealNumber):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> value</span></span></code></pre></div></details><h3 id="emsp-def-raise-type-error-self-other-any-none" tabindex="-1"> <em><strong>def</strong></em> <code>raise_type_error(self, other: Any) -> None</code> <a class="header-anchor" href="#emsp-def-raise-type-error-self-other-any-none" aria-label="Permalink to "&emsp; ***def*** \`raise_type_error(self, other: Any) -> None\`""></a></h3><p> </p><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> raise_type_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> raise</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> TypeError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Unsupported type: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.value)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> and </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(other)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details>`,40),p=[l];function h(e,k,r,d,o,g){return a(),i("div",null,p)}const E=s(t,[["render",h]]);export{y as __pageData,E as default};
|
1
assets/api_mp_math_utils.md.CDwq4icO.lean.js
Normal file
1
assets/api_mp_math_utils.md.CDwq4icO.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.utils","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.utils","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/utils.md","filePath":"api/mp_math/utils.md"}'),t={name:"api/mp_math/utils.md"},l=n("",40),p=[l];function h(e,k,r,d,o,g){return a(),i("div",null,p)}const E=s(t,[["render",h]]);export{y as __pageData,E as default};
|
116
assets/api_mp_math_vector.md.BgK1TmFY.js
Normal file
116
assets/api_mp_math_vector.md.BgK1TmFY.js
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.vector","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.vector","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"api/mp_math/vector.md"}'),e={name:"api/mp_math/vector.md"},t=n(`<h3 id="class-vector3" tabindex="-1"><em><strong>class</strong></em> <code>Vector3</code> <a class="header-anchor" href="#class-vector3" aria-label="Permalink to "***class*** \`Vector3\`""></a></h3><h3 id="emsp-def-init-self-x-float-y-float-z-float-none" tabindex="-1"> <em><strong>def</strong></em> <code>__init__(self, x: float, y: float, z: float) -> None</code> <a class="header-anchor" href="#emsp-def-init-self-x-float-y-float-z-float-none" aria-label="Permalink to "&emsp; ***def*** \`__init__(self, x: float, y: float, z: float) -> None\`""></a></h3><p> 3维向量</p><p>Args:</p><pre><code>x: x轴分量
|
||||||
|
|
||||||
|
y: y轴分量
|
||||||
|
|
||||||
|
z: z轴分量
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, x: </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:#24292E;--shiki-dark:#E1E4E8;">, z: </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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 3维向量</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: x轴分量</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> y: y轴分量</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> z: z轴分量</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;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z</span></span></code></pre></div></details><h3 id="emsp-def-approx-self-other-vector3-epsilon-float-bool" tabindex="-1"> <em><strong>def</strong></em> <code>approx(self, other: 'Vector3', epsilon: float) -> bool</code> <a class="header-anchor" href="#emsp-def-approx-self-other-vector3-epsilon-float-bool" aria-label="Permalink to "&emsp; ***def*** \`approx(self, other: 'Vector3', epsilon: float) -> bool\`""></a></h3><p> 判断两个向量是否近似相等。</p><p>Args:</p><pre><code>other:
|
||||||
|
|
||||||
|
epsilon:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似相等
|
||||||
|
</code></pre><details><summary>源代码</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;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon:</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;"> 是否近似相等</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</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;">([</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;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.x) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon, </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;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.y) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon, </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;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.z) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon])</span></span></code></pre></div></details><h3 id="emsp-def-cal-angle-self-other-vector3-anyangle" tabindex="-1"> <em><strong>def</strong></em> <code>cal_angle(self, other: 'Vector3') -> 'AnyAngle'</code> <a class="header-anchor" href="#emsp-def-cal-angle-self-other-vector3-anyangle" aria-label="Permalink to "&emsp; ***def*** \`cal_angle(self, other: 'Vector3') -> 'AnyAngle'\`""></a></h3><p> 计算两个向量之间的夹角。</p><p>Args:</p><pre><code>other: 另一个向量
|
||||||
|
</code></pre><p>Returns:</p><pre><code>夹角
|
||||||
|
</code></pre><details><summary>源代码</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;"> cal_angle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AnyAngle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 计算两个向量之间的夹角。</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;"> other: 另一个向量</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;"> 夹角</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AnyAngle(math.acos(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> @</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><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:#24292E;--shiki-dark:#E1E4E8;"> other.length)), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">is_radian</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">True</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><h3 id="emsp-def-cross-self-other-vector3-vector3" tabindex="-1"> <em><strong>def</strong></em> <code>cross(self, other: 'Vector3') -> 'Vector3'</code> <a class="header-anchor" href="#emsp-def-cross-self-other-vector3-vector3" aria-label="Permalink to "&emsp; ***def*** \`cross(self, other: 'Vector3') -> 'Vector3'\`""></a></h3><p> 向量积 叉乘:v1 cross v2 -> v3</p><p>叉乘为0,则两向量平行。</p><p>其余结果的模为平行四边形的面积。</p><p>返回如下行列式的结果:</p><p><code>i j k</code></p><p><code>x1 y1 z1</code></p><p><code>x2 y2 z2</code></p><p>Args:</p><pre><code>other:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>行列式的结果
|
||||||
|
</code></pre><details><summary>源代码</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;"> cross</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 向量积 叉乘:v1 cross v2 -> v3</span></span>
|
||||||
|
<span class="line"></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;"> 其余结果的模为平行四边形的面积。</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 返回如下行列式的结果:</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> \`\`i j k\`\`</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> \`\`x1 y1 z1\`\`</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> \`\`x2 y2 z2\`\`</span></span>
|
||||||
|
<span class="line"></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;"> other:</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;"> 行列式的结果</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Vector3(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.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;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.y, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.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;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.z, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</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;"> other.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;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> other.x)</span></span></code></pre></div></details><h3 id="emsp-def-is-approx-parallel-self-other-vector3-epsilon-float-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_approx_parallel(self, other: 'Vector3', epsilon: float) -> bool</code> <a class="header-anchor" href="#emsp-def-is-approx-parallel-self-other-vector3-epsilon-float-bool" aria-label="Permalink to "&emsp; ***def*** \`is_approx_parallel(self, other: 'Vector3', epsilon: float) -> bool\`""></a></h3><p> 判断两个向量是否近似平行。</p><p>Args:</p><pre><code>other: 另一个向量
|
||||||
|
|
||||||
|
epsilon: 允许的误差
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否近似平行
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_approx_parallel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, epsilon: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APPROX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一个向量</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> epsilon: 允许的误差</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;"> 是否近似平行</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.cross(other).length </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> epsilon</span></span></code></pre></div></details><h3 id="emsp-def-is-parallel-self-other-vector3-bool" tabindex="-1"> <em><strong>def</strong></em> <code>is_parallel(self, other: 'Vector3') -> bool</code> <a class="header-anchor" href="#emsp-def-is-parallel-self-other-vector3-bool" aria-label="Permalink to "&emsp; ***def*** \`is_parallel(self, other: 'Vector3') -> bool\`""></a></h3><p> 判断两个向量是否平行。</p><p>Args:</p><pre><code>other: 另一个向量
|
||||||
|
</code></pre><p>Returns:</p><pre><code>是否平行
|
||||||
|
</code></pre><details><summary>源代码</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;"> is_parallel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> other: 另一个向量</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;"> 是否平行</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.cross(other).approx(zero_vector3)</span></span></code></pre></div></details><h3 id="emsp-def-normalize-self-none" tabindex="-1"> <em><strong>def</strong></em> <code>normalize(self) -> None</code> <a class="header-anchor" href="#emsp-def-normalize-self-none" aria-label="Permalink to "&emsp; ***def*** \`normalize(self) -> None\`""></a></h3><p> 将向量归一化。</p><p>自体归一化,不返回值。</p><details><summary>源代码</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;"> normalize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self):</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;"> 将向量归一化。</span></span>
|
||||||
|
<span class="line"></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;"> """</span></span>
|
||||||
|
<span class="line"><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;">.length</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</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;"> length</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> length</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> length</span></span></code></pre></div></details><h3 id="emsp-property" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-np-array-self-any-np-ndarray" tabindex="-1"> <em><strong>def</strong></em> <code>np_array(self: Any) -> 'np.ndarray'</code> <a class="header-anchor" href="#emsp-def-np-array-self-any-np-ndarray" aria-label="Permalink to "&emsp; ***def*** \`np_array(self: Any) -> 'np.ndarray'\`""></a></h3><p> 返回numpy数组</p><p>Returns:</p><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> np_array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'np.ndarray'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 返回numpy数组</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.array([</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.y, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.z])</span></span></code></pre></div></details><h3 id="emsp-property-1" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-1" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-length-self-any-float" tabindex="-1"> <em><strong>def</strong></em> <code>length(self: Any) -> float</code> <a class="header-anchor" href="#emsp-def-length-self-any-float" aria-label="Permalink to "&emsp; ***def*** \`length(self: Any) -> float\`""></a></h3><p> 向量的模。</p><p>Returns:</p><pre><code>模
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> length</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </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;"> """</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;"> Returns:</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;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> math.sqrt(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</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;">.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:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.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><h3 id="emsp-property-2" tabindex="-1"> <em><strong>@property</strong></em> <a class="header-anchor" href="#emsp-property-2" aria-label="Permalink to "&emsp; ***@property***""></a></h3><h3 id="emsp-def-unit-self-any-vector3" tabindex="-1"> <em><strong>def</strong></em> <code>unit(self: Any) -> 'Vector3'</code> <a class="header-anchor" href="#emsp-def-unit-self-any-vector3" aria-label="Permalink to "&emsp; ***def*** \`unit(self: Any) -> 'Vector3'\`""></a></h3><p> 获取该向量的单位向量。</p><p>Returns:</p><pre><code>单位向量
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">property</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> unit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Vector3'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</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;"> 获取该向量的单位向量。</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;"> 单位向量</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</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;">.length</span></span></code></pre></div></details><h3 id="var-zero-vector3-vector3-0-0-0" tabindex="-1"><em><strong>var</strong></em> <code>zero_vector3 = Vector3(0, 0, 0)</code> <a class="header-anchor" href="#var-zero-vector3-vector3-0-0-0" aria-label="Permalink to "***var*** \`zero_vector3 = Vector3(0, 0, 0)\`""></a></h3><h3 id="var-x-axis-vector3-1-0-0" tabindex="-1"><em><strong>var</strong></em> <code>x_axis = Vector3(1, 0, 0)</code> <a class="header-anchor" href="#var-x-axis-vector3-1-0-0" aria-label="Permalink to "***var*** \`x_axis = Vector3(1, 0, 0)\`""></a></h3><h3 id="var-y-axis-vector3-0-1-0" tabindex="-1"><em><strong>var</strong></em> <code>y_axis = Vector3(0, 1, 0)</code> <a class="header-anchor" href="#var-y-axis-vector3-0-1-0" aria-label="Permalink to "***var*** \`y_axis = Vector3(0, 1, 0)\`""></a></h3><h3 id="var-z-axis-vector3-0-0-1" tabindex="-1"><em><strong>var</strong></em> <code>z_axis = Vector3(0, 0, 1)</code> <a class="header-anchor" href="#var-z-axis-vector3-0-0-1" aria-label="Permalink to "***var*** \`z_axis = Vector3(0, 0, 1)\`""></a></h3><h3 id="var-length-self-length" tabindex="-1"><em><strong>var</strong></em> <code>length = self.length</code> <a class="header-anchor" href="#var-length-self-length" aria-label="Permalink to "***var*** \`length = self.length\`""></a></h3>`,73),l=[t];function p(h,k,r,o,d,g){return a(),i("div",null,l)}const F=s(e,[["render",p]]);export{y as __pageData,F as default};
|
1
assets/api_mp_math_vector.md.BgK1TmFY.lean.js
Normal file
1
assets/api_mp_math_vector.md.BgK1TmFY.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const y=JSON.parse('{"title":"mbcp.mp\\\\nmath.vector","description":"","frontmatter":{"title":"mbcp.mp\\\\nmath.vector","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/mp_math/vector.md","filePath":"api/mp_math/vector.md"}'),e={name:"api/mp_math/vector.md"},t=n("",73),l=[t];function p(h,k,r,o,d,g){return a(),i("div",null,l)}const F=s(e,[["render",p]]);export{y as __pageData,F as default};
|
1
assets/api_particle_index.md.BqH-w2FR.js
Normal file
1
assets/api_particle_index.md.BqH-w2FR.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as a}from"./chunks/framework.BV61Qrc0.js";const m=JSON.parse('{"title":"mbcp.particle.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.particle.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/particle/index.md","filePath":"api/particle/index.md"}'),n={name:"api/particle/index.md"};function i(r,c,p,o,d,s){return a(),t("div")}const _=e(n,[["render",i]]);export{m as __pageData,_ as default};
|
1
assets/api_particle_index.md.BqH-w2FR.lean.js
Normal file
1
assets/api_particle_index.md.BqH-w2FR.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as a}from"./chunks/framework.BV61Qrc0.js";const m=JSON.parse('{"title":"mbcp.particle.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.particle.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/particle/index.md","filePath":"api/particle/index.md"}'),n={name:"api/particle/index.md"};function i(r,c,p,o,d,s){return a(),t("div")}const _=e(n,[["render",i]]);export{m as __pageData,_ as default};
|
1
assets/api_presets_index.md.CvgR5vOS.js
Normal file
1
assets/api_presets_index.md.CvgR5vOS.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.presets.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.presets.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/presets/index.md","filePath":"api/presets/index.md"}'),r={name:"api/presets/index.md"};function s(a,i,p,o,c,d){return n(),t("div")}const l=e(r,[["render",s]]);export{_ as __pageData,l as default};
|
1
assets/api_presets_index.md.CvgR5vOS.lean.js
Normal file
1
assets/api_presets_index.md.CvgR5vOS.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as n}from"./chunks/framework.BV61Qrc0.js";const _=JSON.parse('{"title":"mbcp.presets.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.presets.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/presets/index.md","filePath":"api/presets/index.md"}'),r={name:"api/presets/index.md"};function s(a,i,p,o,c,d){return n(),t("div")}const l=e(r,[["render",s]]);export{_ as __pageData,l as default};
|
43
assets/api_presets_model_index.md.D1iZ1qEr.js
Normal file
43
assets/api_presets_model_index.md.D1iZ1qEr.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const o=JSON.parse('{"title":"mbcp.presets.model.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.presets.model.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n(`<h3 id="def-sphere-radius-float-density-float-none" tabindex="-1"><em><strong>def</strong></em> <code>sphere(radius: float, density: float) -> None</code> <a class="header-anchor" href="#def-sphere-radius-float-density-float-none" aria-label="Permalink to "***def*** \`sphere(radius: float, density: float) -> None\`""></a></h3><p>生成球体上的点集。</p><p>Args:</p><pre><code>radius:
|
||||||
|
|
||||||
|
density:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>List[Point3]: 球体上的点集。
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sphere</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(radius: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, density: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> radius:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> density:</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;"> List[Point3]: 球体上的点集。</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 4</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> density)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> phi_list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.arccos([clamp(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2.0</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _ </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _ </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)])</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> theta_list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sqrt(num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> phi_list</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(theta_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(theta_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(phi_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details><h3 id="class-geometricmodels" tabindex="-1"><em><strong>class</strong></em> <code>GeometricModels</code> <a class="header-anchor" href="#class-geometricmodels" aria-label="Permalink to "***class*** \`GeometricModels\`""></a></h3><h3 id="emsp-staticmethod" tabindex="-1"> <em><strong>@staticmethod</strong></em> <a class="header-anchor" href="#emsp-staticmethod" aria-label="Permalink to "&emsp; ***@staticmethod***""></a></h3><h3 id="emsp-def-sphere-radius-float-density-float-none" tabindex="-1"> <em><strong>def</strong></em> <code>sphere(radius: float, density: float) -> None</code> <a class="header-anchor" href="#emsp-def-sphere-radius-float-density-float-none" aria-label="Permalink to "&emsp; ***def*** \`sphere(radius: float, density: float) -> None\`""></a></h3><p> 生成球体上的点集。</p><p>Args:</p><pre><code>radius:
|
||||||
|
|
||||||
|
density:
|
||||||
|
</code></pre><p>Returns:</p><pre><code>List[Point3]: 球体上的点集。
|
||||||
|
</code></pre><details><summary>源代码</summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">staticmethod</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sphere</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(radius: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, density: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">float</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#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;"> Args:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> radius:</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> density:</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;"> List[Point3]: 球体上的点集。</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> """</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 4</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(area </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> density)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> phi_list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.arccos([clamp(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2.0</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _ </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _ </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)])</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> theta_list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sqrt(num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.pi) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> phi_list</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(theta_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> y_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(phi_list) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.sin(theta_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> z_array </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> radius </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> np.cos(phi_list)</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [Point3(x_array[i], y_array[i], z_array[i]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> i </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> range</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num)]</span></span></code></pre></div></details><h3 id="var-area-4-np-pi-radius-2" tabindex="-1"><em><strong>var</strong></em> <code>area = 4 * np.pi * radius ** 2</code> <a class="header-anchor" href="#var-area-4-np-pi-radius-2" aria-label="Permalink to "***var*** \`area = 4 * np.pi * radius ** 2\`""></a></h3><h3 id="var-num-int-area-density" tabindex="-1"><em><strong>var</strong></em> <code>num = int(area * density)</code> <a class="header-anchor" href="#var-num-int-area-density" aria-label="Permalink to "***var*** \`num = int(area * density)\`""></a></h3><h3 id="var-phi-list-np-arccos-clamp-1-2-0-1-0-num-1-1-for-in-range-num" tabindex="-1"><em><strong>var</strong></em> <code>phi_list = np.arccos([clamp(-1 + (2.0 * _ - 1.0) / num, -1, 1) for _ in range(num)])</code> <a class="header-anchor" href="#var-phi-list-np-arccos-clamp-1-2-0-1-0-num-1-1-for-in-range-num" aria-label="Permalink to "***var*** \`phi_list = np.arccos([clamp(-1 + (2.0 * _ - 1.0) / num, -1, 1) for _ in range(num)])\`""></a></h3><h3 id="var-theta-list-np-sqrt-num-np-pi-phi-list" tabindex="-1"><em><strong>var</strong></em> <code>theta_list = np.sqrt(num * np.pi) * phi_list</code> <a class="header-anchor" href="#var-theta-list-np-sqrt-num-np-pi-phi-list" aria-label="Permalink to "***var*** \`theta_list = np.sqrt(num * np.pi) * phi_list\`""></a></h3><h3 id="var-x-array-radius-np-sin-phi-list-np-cos-theta-list" tabindex="-1"><em><strong>var</strong></em> <code>x_array = radius * np.sin(phi_list) * np.cos(theta_list)</code> <a class="header-anchor" href="#var-x-array-radius-np-sin-phi-list-np-cos-theta-list" aria-label="Permalink to "***var*** \`x_array = radius * np.sin(phi_list) * np.cos(theta_list)\`""></a></h3><h3 id="var-y-array-radius-np-sin-phi-list-np-sin-theta-list" tabindex="-1"><em><strong>var</strong></em> <code>y_array = radius * np.sin(phi_list) * np.sin(theta_list)</code> <a class="header-anchor" href="#var-y-array-radius-np-sin-phi-list-np-sin-theta-list" aria-label="Permalink to "***var*** \`y_array = radius * np.sin(phi_list) * np.sin(theta_list)\`""></a></h3><h3 id="var-z-array-radius-np-cos-phi-list" tabindex="-1"><em><strong>var</strong></em> <code>z_array = radius * np.cos(phi_list)</code> <a class="header-anchor" href="#var-z-array-radius-np-cos-phi-list" aria-label="Permalink to "***var*** \`z_array = radius * np.cos(phi_list)\`""></a></h3>`,23),p=[h];function l(k,e,r,d,E,y){return a(),i("div",null,p)}const c=s(t,[["render",l]]);export{o as __pageData,c as default};
|
1
assets/api_presets_model_index.md.D1iZ1qEr.lean.js
Normal file
1
assets/api_presets_model_index.md.D1iZ1qEr.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const o=JSON.parse('{"title":"mbcp.presets.model.\\\\n\\\\ninit\\\\n\\\\n","description":"","frontmatter":{"title":"mbcp.presets.model.\\\\n\\\\ninit\\\\n\\\\n","order":1,"icon":"laptop-code","category":"API"},"headers":[],"relativePath":"api/presets/model/index.md","filePath":"api/presets/model/index.md"}'),t={name:"api/presets/model/index.md"},h=n("",23),p=[h];function l(k,e,r,d,E,y){return a(),i("div",null,p)}const c=s(t,[["render",l]]);export{o as __pageData,c as default};
|
1
assets/app.l1Ut0uce.js
Normal file
1
assets/app.l1Ut0uce.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{t as i}from"./chunks/theme.BPuUWxkA.js";import{U as o,a3 as u,a4 as c,a5 as l,a6 as f,a7 as d,a8 as m,a9 as h,aa as g,ab as A,ac as y,d as P,u as v,y as C,x as b,ad as w,ae as E,af as R,ag as S}from"./chunks/framework.BV61Qrc0.js";function p(e){if(e.extends){const a=p(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=p(i),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return C(()=>{b(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&w(),E(),R(),s.setup&&s.setup(),()=>S(s.Layout)}});async function x(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function D(){return g(T)}function _(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&x().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{x as createApp};
|
17
assets/chunks/framework.BV61Qrc0.js
Normal file
17
assets/chunks/framework.BV61Qrc0.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/chunks/theme.BPuUWxkA.js
Normal file
1
assets/chunks/theme.BPuUWxkA.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/index.md.CJvRmMfL.js
Normal file
1
assets/index.md.CJvRmMfL.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as a}from"./chunks/framework.BV61Qrc0.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"MBCP docs","text":"More basic change particle","tagline":"用于几何运算和粒子制作的库","actions":[{"theme":"brand","text":"快速开始","link":"md-ex"},{"theme":"alt","text":"API文档","link":"api/"}]},"features":[{"title":"高可用性","details":"通过简单的接口,实现了大部分几何运算和粒子制作的需求"},{"title":"高集成度","details":"对<code>numpy</code>、<code>scipy</code>及<code>sumpy</code>进行了封装和集成,使脚本编写像使用Geogebra一样简单"},{"title":"内置预设","details":"提供了大量的预设,包括常见的几何图形、粒子效果等,方便快速制作"}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),o={name:"index.md"};function i(c,n,d,s,r,l){return a(),t("div")}const x=e(o,[["render",i]]);export{p as __pageData,x as default};
|
1
assets/index.md.CJvRmMfL.lean.js
Normal file
1
assets/index.md.CJvRmMfL.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as e,c as t,o as a}from"./chunks/framework.BV61Qrc0.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"MBCP docs","text":"More basic change particle","tagline":"用于几何运算和粒子制作的库","actions":[{"theme":"brand","text":"快速开始","link":"md-ex"},{"theme":"alt","text":"API文档","link":"api/"}]},"features":[{"title":"高可用性","details":"通过简单的接口,实现了大部分几何运算和粒子制作的需求"},{"title":"高集成度","details":"对<code>numpy</code>、<code>scipy</code>及<code>sumpy</code>进行了封装和集成,使脚本编写像使用Geogebra一样简单"},{"title":"内置预设","details":"提供了大量的预设,包括常见的几何图形、粒子效果等,方便快速制作"}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),o={name:"index.md"};function i(c,n,d,s,r,l){return a(),t("div")}const x=e(o,[["render",i]]);export{p as __pageData,x as default};
|
BIN
assets/inter-italic-cyrillic-ext.r48I6akx.woff2
Normal file
BIN
assets/inter-italic-cyrillic-ext.r48I6akx.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-cyrillic.By2_1cv3.woff2
Normal file
BIN
assets/inter-italic-cyrillic.By2_1cv3.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-greek-ext.1u6EdAuj.woff2
Normal file
BIN
assets/inter-italic-greek-ext.1u6EdAuj.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-greek.DJ8dCoTZ.woff2
Normal file
BIN
assets/inter-italic-greek.DJ8dCoTZ.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-latin-ext.CN1xVJS-.woff2
Normal file
BIN
assets/inter-italic-latin-ext.CN1xVJS-.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-latin.C2AdPX0b.woff2
Normal file
BIN
assets/inter-italic-latin.C2AdPX0b.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-vietnamese.BSbpV94h.woff2
Normal file
BIN
assets/inter-italic-vietnamese.BSbpV94h.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2
Normal file
BIN
assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-cyrillic.C5lxZ8CY.woff2
Normal file
BIN
assets/inter-roman-cyrillic.C5lxZ8CY.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-greek-ext.CqjqNYQ-.woff2
Normal file
BIN
assets/inter-roman-greek-ext.CqjqNYQ-.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-greek.BBVDIX6e.woff2
Normal file
BIN
assets/inter-roman-greek.BBVDIX6e.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-latin-ext.4ZJIpNVo.woff2
Normal file
BIN
assets/inter-roman-latin-ext.4ZJIpNVo.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-latin.Di8DUHzh.woff2
Normal file
BIN
assets/inter-roman-latin.Di8DUHzh.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-vietnamese.BjW4sHH5.woff2
Normal file
BIN
assets/inter-roman-vietnamese.BjW4sHH5.woff2
Normal file
Binary file not shown.
33
assets/md-ex.md.BX0WqOqv.js
Normal file
33
assets/md-ex.md.BX0WqOqv.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const g=JSON.parse('{"title":"Markdown Extension Examples","description":"","frontmatter":{},"headers":[],"relativePath":"md-ex.md","filePath":"md-ex.md"}'),t={name:"md-ex.md"},e=n(`<h1 id="markdown-extension-examples" tabindex="-1">Markdown Extension Examples <a class="header-anchor" href="#markdown-extension-examples" aria-label="Permalink to "Markdown Extension Examples""></a></h1><p>This page demonstrates some of the built-in markdown extensions provided by VitePress.</p><h2 id="syntax-highlighting" tabindex="-1">Syntax Highlighting <a class="header-anchor" href="#syntax-highlighting" aria-label="Permalink to "Syntax Highlighting""></a></h2><p>VitePress provides Syntax Highlighting powered by <a href="https://github.com/shikijs/shiki" target="_blank" rel="noreferrer">Shiki</a>, with additional features like line-highlighting:</p><p><strong>Input</strong></p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">\`\`\`js{4}</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> data</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () {</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Highlighted!'</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">\`\`\`</span></span></code></pre></div><p><strong>Output</strong></p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> data</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () {</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||||
|
<span class="line highlighted"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Highlighted!'</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="custom-containers" tabindex="-1">Custom Containers <a class="header-anchor" href="#custom-containers" aria-label="Permalink to "Custom Containers""></a></h2><p><strong>Input</strong></p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::: info</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This is an info box.</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:::</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::: tip</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This is a tip.</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:::</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::: warning</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This is a warning.</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:::</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::: danger</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This is a dangerous warning.</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:::</span></span>
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::: details</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This is a details block.</span></span>
|
||||||
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:::</span></span></code></pre></div><p><strong>Output</strong></p><div class="info custom-block"><p class="custom-block-title">INFO</p><p>This is an info box.</p></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>This is a tip.</p></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>This is a warning.</p></div><div class="danger custom-block"><p class="custom-block-title">DANGER</p><p>This is a dangerous warning.</p></div><details class="details custom-block"><summary>Details</summary><p>This is a details block.</p></details><h2 id="more" tabindex="-1">More <a class="header-anchor" href="#more" aria-label="Permalink to "More""></a></h2><p>Check out the documentation for the <a href="https://vitepress.dev/guide/markdown" target="_blank" rel="noreferrer">full list of markdown extensions</a>.</p>`,19),l=[e];function p(h,k,r,d,o,E){return a(),i("div",null,l)}const m=s(t,[["render",p]]);export{g as __pageData,m as default};
|
1
assets/md-ex.md.BX0WqOqv.lean.js
Normal file
1
assets/md-ex.md.BX0WqOqv.lean.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
import{_ as s,c as i,o as a,a2 as n}from"./chunks/framework.BV61Qrc0.js";const g=JSON.parse('{"title":"Markdown Extension Examples","description":"","frontmatter":{},"headers":[],"relativePath":"md-ex.md","filePath":"md-ex.md"}'),t={name:"md-ex.md"},e=n("",19),l=[e];function p(h,k,r,d,o,E){return a(),i("div",null,l)}const m=s(t,[["render",p]]);export{g as __pageData,m as default};
|
1
assets/style.Bb0QBJmh.css
Normal file
1
assets/style.Bb0QBJmh.css
Normal file
File diff suppressed because one or more lines are too long
1
hashmap.json
Normal file
1
hashmap.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"api-ex.md":"DOsKaL8H","api_index.md":"CsKClHFh","api_mp_math_angle.md":"9eUTSIe4","api_mp_math_const.md":"Bhz27OPg","api_mp_math_equation.md":"xiyFVY1c","api_mp_math_index.md":"DTIfeUA1","api_mp_math_line.md":"BybnyRUL","api_mp_math_mp_math_typing.md":"DXaadYgy","api_mp_math_plane.md":"Cdj0PlKB","api_mp_math_point.md":"D3f-vzVt","api_mp_math_segment.md":"DIViBThe","api_mp_math_utils.md":"CDwq4icO","api_mp_math_vector.md":"BgK1TmFY","api_particle_index.md":"BqH-w2FR","api_presets_index.md":"CvgR5vOS","api_presets_model_index.md":"D1iZ1qEr","index.md":"CJvRmMfL","md-ex.md":"BX0WqOqv"}
|
24
index.html
Normal file
24
index.html
Normal file
File diff suppressed because one or more lines are too long
56
md-ex.html
Normal file
56
md-ex.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user