2024-08-28 20:35:22 +08:00
<!DOCTYPE html>
< html lang = "en-US" dir = "ltr" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
< title > mbcp.mp_math.plane | MBCP docs< / title >
2024-08-31 06:08:36 +08:00
< meta name = "description" content = "MBCP library docs" >
2024-08-28 20:35:22 +08:00
< meta name = "generator" content = "VitePress v1.3.4" >
2024-09-06 19:59:45 +08:00
< link rel = "preload stylesheet" href = "/assets/style.Czi07tLB.css" as = "style" >
2024-08-28 20:35:22 +08:00
2024-09-06 20:06:01 +08:00
< script type = "module" src = "/assets/app.CrOlCLzC.js" > < / script >
< link rel = "modulepreload" href = "/assets/chunks/theme.CNTs-oFm.js" >
2024-08-31 07:55:26 +08:00
< link rel = "modulepreload" href = "/assets/chunks/framework.DpC1ZpOZ.js" >
2024-09-06 19:59:45 +08:00
< link rel = "modulepreload" href = "/assets/en_api_mp_math_plane.md.CBNCeDF4.lean.js" >
2024-08-31 06:08:36 +08:00
< link rel = "icon" type = "image/svg+xml" href = "/mbcp-logo.svg" >
2024-08-31 07:31:49 +08:00
< link rel = "stylesheet" href = "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" >
2024-08-28 20:35:22 +08:00
< script id = "check-dark-mode" > ( ( ) => { const e = localStorage . getItem ( "vitepress-theme-appearance" ) || "auto" , a = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ; ( ! e || e === "auto" ? a : e === "dark" ) && document . documentElement . classList . add ( "dark" ) } ) ( ) ; < / script >
< script id = "check-mac-os" > document . documentElement . classList . toggle ( "mac" , /Mac|iPhone|iPod|iPad/i . test ( navigator . platform ) ) ; < / script >
< / head >
< body >
2024-09-04 19:22:16 +08:00
< div id = "app" > < div class = "Layout" data-v-3b4648ff > <!-- [ --> <!-- ] --> <!-- [ --> < span tabindex = "-1" data-v-e813112c > < / span > < a href = "#VPContent" class = "VPSkipLink visually-hidden" data-v-e813112c > Skip to content < / a > <!-- ] --> <!-- --> < header class = "VPNav" data-v-3b4648ff data-v-e823d444 > < div class = "VPNavBar has-sidebar top" data-v-e823d444 data-v-da0688be > < div class = "wrapper" data-v-da0688be > < div class = "container" data-v-da0688be > < div class = "title" data-v-da0688be > < div class = "VPNavBarTitle has-sidebar" data-v-da0688be data-v-606a7e0f > < a class = "title" href = "/en/" data-v-606a7e0f > <!-- [ --> <!-- ] --> <!-- [ --> < img class = "VPImage logo" src = "/mbcp-logo.svg" alt data-v-cc63e071 > <!-- ] --> < span data-v-606a7e0f > MBCP docs< / span > <!-- [ --> <!-- ] --> < / a > < / div > < / div > < div class = "content" data-v-da0688be > < div class = "content-body" data-v-da0688be > <!-- [ --> <!-- ] --> < div class = "VPNavBarSearch search" data-v-da0688be > <!-- [ --> <!-- --> < div id = "local-search" > < button type = "button" class = "DocSearch DocSearch-Button" aria-label = "Search" > < span class = "DocSearch-Button-Container" > < span class = "vp-icon DocSearch-Search-Icon" > < / span > < span class = "DocSearch-Button-Placeholder" > Search< / span > < / span > < span class = "DocSearch-Button-Keys" > < kbd class = "DocSearch-Button-Key" > < / kbd > < kbd class = "DocSearch-Button-Key" > K< / kbd > < / span > < / button > < / div > <!-- ] --> < / div > < nav aria-labelledby = "main-nav-aria-label" class = "VPNavBarMenu menu" data-v-da0688be data-v-bf53b681 > < span id = "main-nav-aria-label" class = "visually-hidden" data-v-bf53b681 > Main Navigation < / span > <!-- [ --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/guide/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Get Start< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/refer.html" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Reference< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/api/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > API Reference< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/demo/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Demo< / span > <!-- ] --> < / a > <!-- ] --> <!-- ] --> < / nav > < div class = "VPFlyout VPNavBarTranslations translations" data-v-da0688be data-v-912817b1 data-v-00660109 > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "Change language" data-v-00660109 > < span class = "text" data-v-00660109 > < span class = "vpi-languages option-icon" data-v-00660109 > < / span > <!-- --> < span class = "vpi-chevron-down text-icon" data-v-00660109 > < / span > < / span > < / button > < div class = "menu" data-v-00660109 > < div class = "VPMenu" data-v-00660109 data-v-809b8af7 > <!-- --> <!-- [ --> <!-- [ --> < div class = "items" data-v-912817b1 > < p class = "title" data-v-912817b1 > English< / p > <!-- [ --> < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/api/mp_math/plane.html" data-v-25a54821 > <!-- [ --> 简体中文<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/ja/api/mp_math/plane.html" data-v-25a54821 > <!-- [ --> 日本語<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/zht/api/mp_math/plane.html" data-v-25a54821 > <!-- [ --> 繁體中文<!-- ] --> < / a > < / div > <!-- ] --> < / div > <!-- ] --> <!-- ] --> < / div > < / div > < / div > < div class = "VPNavBarAppearance appearance" data-v-da0688be data-v-864d2abc > < button class = "VPSwitch VPSwitchAppearance" type = "button" role = "switch" title = "Switch to dark theme" aria-checked = "false" data-v-864d2abc data-v-3125216b data-v-846fe538 > < span class = "check" data-v-846fe538 > < span class = "icon" data-v-846fe538 > <!-- [ --> < span class = "vpi-sun sun" data-v-3125216b > < / span > < span class = "vpi-moon moon" data-v-3125216b > < / span > <!-- ] --> < / span > < / span > < / button > < / div > < div class = "VPSocialLinks VPNavBarSocialLinks social-links" data-v-da0688be data-v-2c606308 data-v-100434c4 > <!-- [ --> < a class = "VPSocialLink no-icon" href = "https://github.com/snowykami/mbcp" aria-label = "github" target = "_blank" rel = "noopen
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > a< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > b< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > c< / span > < / span >
2024-09-03 22:49:39 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .d < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > d< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-approx-self-other-plane3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > approx(self, other: Plane3) -> bool< / code > < a class = "header-anchor" href = "#method-approx-self-other-plane3-bool" aria-label = "Permalink to "***method*** `approx(self, other: Plane3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两个平面是否近似相等。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > ): 另一个平面< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否近似相等< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L34" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > approx< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Plane3' < / 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 >
2024-08-28 20:35:22 +08:00
< 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;" > .a < / 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:#24292E;--shiki-dark:#E1E4E8;" > k < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.a < / 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;" > .a< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.b, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.c, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.d, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .d < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k)< / 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;" > .b < / 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:#24292E;--shiki-dark:#E1E4E8;" > k < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.b < / 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;" > .b< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.a, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.c, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.d, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .d < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k)< / 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;" > .c < / 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:#24292E;--shiki-dark:#E1E4E8;" > k < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.c < / 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;" > .c< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.a, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.b, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > approx(other.d, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .d < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > k)< / 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 >
2024-09-06 15:44:53 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > False< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-angle-self-other-line3-plane3-anyangle" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_angle(self, other: Line3 | Plane3) -> AnyAngle< / code > < a class = "header-anchor" href = "#method-cal-angle-self-other-line3-plane3-anyangle" aria-label = "Permalink to "***method*** `cal_angle(self, other: Line3 | Plane3) -> AnyAngle`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算平面与平面之间的夹角。< / p > < div class = "tip custom-block" > < p class = "custom-block-title" > TIP< / p > < p > 平面间夹角计算公式:< / p > < mjx-container tabindex = "0" class = "MathJax" jax = "SVG" display = "true" style = "direction:ltr;display:block;text-align:center;margin:1em 0;position:relative;" > < svg style = "overflow:visible;min-height:1px;min-width:1px;vertical-align:-2.17ex;" xmlns = "http://www.w3.org/2000/svg" width = "22.011ex" height = "5.206ex" role = "img" focusable = "false" viewBox = "0 -1342 9729 2301" aria-hidden = "true" > < g stroke = "currentColor" fill = "currentColor" stroke-width = "0" transform = "scale(1,-1)" > < g data-mml-node = "math" > < g data-mml-node = "mi" > < path data-c = "1D703" d = "M35 200Q35 302 74 415T180 610T319 704Q320 704 327 704T339 705Q393 701 423 656Q462 596 462 495Q462 380 417 261T302 66T168 -10H161Q125 -10 99 10T60 63T41 130T35 200ZM383 566Q383 668 330 668Q294 668 260 623T204 521T170 421T157 371Q206 370 254 370L351 371Q352 372 359 404T375 484T383 566ZM113 132Q113 26 166 26Q181 26 198 36T239 74T287 161T335 307L340 324H145Q145 321 136 286T120 208T113 132Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mo" transform = "translate(746.8,0)" > < path data-c = "3D" d = "M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mi" transform = "translate(1802.6,0)" > < path data-c = "61" d = "M137 305T115 305T78 320T63 359Q63 394 97 421T218 448Q291 448 336 416T396 340Q401 326 401 309T402 194V124Q402 76 407 58T428 40Q443 40 448 56T453 109V145H493V106Q492 66 490 59Q481 29 455 12T400 -6T353 12T329 54V58L327 55Q325 52 322 49T314 40T302 29T287 17T269 6T247 -2T221 -8T190 -11Q130 -11 82 20T34 107Q34 128 41 147T68 188T116 225T194 253T304 268H318V290Q318 324 312 340Q290 411 215 411Q197 411 181 410T156 406T148 403Q170 388 170 359Q170 334 154 320ZM126 106Q126 75 150 51T209 26Q247 26 276 49T315 109Q317 116 318 175Q318 233 317 233Q309 233 296 232T251 223T193 203T147 166T126 106Z" style = "stroke-width:3;" > < / path > < path data-c = "72" d = "M36 46H50Q89 46 97 60V68Q97 77 97 91T98 122T98 161T98 203Q98 234 98 269T98 328L97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 60 434T96 436Q112 437 131 438T160 441T171 442H174V373Q213 441 271 441H277Q322 441 343 419T364 373Q364 352 351 337T313 322Q288 322 276 338T263 372Q263 381 265 388T270 400T273 405Q271 407 250 401Q234 393 226 386Q179 341 179 207V154Q179 141 179 127T179 101T180 81T180 66V61Q181 59 183 57T188 54T193 51T200 49T207 48T216 47T225 47T235 46T245 46H276V0H267Q249 3 140 3Q37 3 28 0H20V46H36Z" transform = "translate(500,0)" style = "stroke-width:3;" > < / path > < path data-c = "63" d = "M370 305T349 305T313 320T297 358Q297 381 312 396Q317 401 317 402T307 404Q281 408 258 408Q209 408 178 376Q131 329 131 219Q131 137 162 90Q203 29 272 29Q313 29 338 55T374 117Q376 125 379 127T395 129H409Q415 123 415 120Q415 116 411 104T395 71T366 33T318 2T249 -11Q163 -11 99 53T34 214Q34 318 99 383T250 448T370 421T404 357Q404 334 387 320Z" transform = "translate(892,0)" style = "stroke-width:3;" > < / path > < path data-c = "63" d = "M370 305T349 305T313 320T297 358Q297 381 312 396Q317 401 317 402T307 404Q281 408 258 408Q209 408 178 376Q131 329 131 219Q131 137 162 90Q203 29 272 29Q313 29 338 55T374 117Q376 125 379 127T395 129H409Q415 123 415 120Q415 116 411 104T395 71T366 33T318 2T249 -11Q163 -11 99 53T34 214Q34 318 99 383T250 448T370 421T404 357Q404 334 387 320Z" transform = "translate(1336,0)"
2024-08-28 20:35:22 +08:00
< 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;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .normal.cal_angle(other.direction).complementary< / 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, Plane3):< / 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:#24292E;--shiki-dark:#E1E4E8;" > .normal < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.normal < / 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;" > .normal.length < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.normal.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 >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-06 15:44:53 +08:00
< 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;" > (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 > < h4 id = "method-cal-distance-self-other-plane3-point3-float" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_distance(self, other: Plane3 | Point3) -> float< / code > < a class = "header-anchor" href = "#method-cal-distance-self-other-plane3-point3-float" aria-label = "Permalink to "***method*** `cal_distance(self, other: Plane3 | Point3) -> float`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算平面与平面或点之间的距离。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > | < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 另一个平面或点< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#float" target = "_blank" rel = "noreferrer" > < code > float< / code > < / a > : 距离< / p > < p > < strong > Raises< / strong > :< / p > < blockquote > < ul > < li > < a href = "https://docs.python.org/3/library/exceptions.html#TypeError" target = "_blank" rel = "noreferrer" > < code > TypeError< / code > < / a > 不支持的类型< / li > < / ul > < / blockquote > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L81" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_distance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Plane3 | 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 >
2024-08-28 20:35:22 +08:00
< 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, Plane3):< / 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:#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;" > .a < / 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;" > .b < / 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;" > .c < / 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;" > .d) < / 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;" > .a < / 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;" > .b < / 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;" > .c < / 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:#D73A49;--shiki-dark:#F97583;" > **< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0.5< / 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 >
2024-09-06 15:44:53 +08:00
< 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;" > (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 > < h4 id = "method-cal-intersection-line3-self-other-plane3-line3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_intersection_line3(self, other: Plane3) -> Line3< / code > < a class = "header-anchor" href = "#method-cal-intersection-line3-self-other-plane3-line3" aria-label = "Permalink to "***method*** `cal_intersection_line3(self, other: Plane3) -> Line3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算两平面的交线。< / p > < div class = "tip custom-block" > < p class = "custom-block-title" > TIP< / p > < p > 计算两平面交线的一般步骤:< / p > < ol > < li > 求两平面的法向量的叉乘得到方向向量< / li > < / ol > < mjx-container tabindex = "0" class = "MathJax" jax = "SVG" display = "true" style = "direction:ltr;display:block;text-align:center;margin:1em 0;position:relative;" > < svg style = "overflow:visible;min-height:1px;min-width:1px;vertical-align:-0.186ex;" xmlns = "http://www.w3.org/2000/svg" width = "11.937ex" height = "1.756ex" role = "img" focusable = "false" viewBox = "0 -694 5276 776" aria-hidden = "true" > < g stroke = "currentColor" fill = "currentColor" stroke-width = "0" transform = "scale(1,-1)" > < g data-mml-node = "math" > < g data-mml-node = "mi" > < path data-c = "1D451" d = "M366 683Q367 683 438 688T511 694Q523 694 523 686Q523 679 450 384T375 83T374 68Q374 26 402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487H491Q506 153 506 145Q506 140 503 129Q490 79 473 48T445 8T417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157Q33 205 53 255T101 341Q148 398 195 420T280 442Q336 442 364 400Q369 394 369 396Q370 400 396 505T424 616Q424 629 417 632T378 637H357Q351 643 351 645T353 664Q358 683 366 683ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mo" transform = "translate(797.8,0)" > < path data-c = "3D" d = "M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mi" transform = "translate(1853.6,0)" > < path data-c = "1D45B" d = "M21 287Q22 293 24 303T36 341T56 388T89 425T135 442Q171 442 195 424T225 390T231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336T465 179T427 52Q427 26 444 26Q450 26 453 27Q482 32 505 65T540 145Q542 153 560 153Q580 153 580 145Q580 144 576 130Q568 101 554 73T508 17T439 -10Q392 -10 371 17T350 73Q350 92 386 193T423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 180T152 343Q153 348 153 366Q153 405 129 405Q91 405 66 305Q60 285 60 284Q58 278 41 278H27Q21 284 21 287Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mn" transform = "translate(2453.6,0)" > < path data-c = "31" d = "M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mo" transform = "translate(3175.8,0)" > < path data-c = "D7" d = "M630 29Q630 9 609 9Q604 9 587 25T493 118L389 222L284 117Q178 13 175 11Q171 9 168 9Q160 9 154 15T147
2024-08-28 20:35:22 +08:00
< 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;" > .normal.is_parallel(other.normal):< / 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;" > ' Planes are parallel and have no intersection.' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / 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:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .normal.cross(other.normal)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x, y, z < / 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;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , < / 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;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > !=< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.a < / 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:#24292E;--shiki-dark:#E1E4E8;" > A < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / 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;" > .b, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c], [other.b, other.c]])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > B < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.array([< / 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;" > .d, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.d])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > y, z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.linalg.solve(A, B)< / 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;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > !=< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.b < / 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:#24292E;--shiki-dark:#E1E4E8;" > A < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / 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;" > .a, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c], [other.a, other.c]])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > B < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.array([< / 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;" > .d, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.d])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x, z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.linalg.solve(A, B)< / 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;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > !=< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.c < / 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:#24292E;--shiki-dark:#E1E4E8;" > A < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / 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;" > .a, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .b], [other.a, other.b]])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > B < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.array([< / 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;" > .d, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.d])< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x, y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > np.linalg.solve(A, B)< / span > < / span >
2024-09-06 15:44:53 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > Line3(Point3(x, y, z), direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-intersection-point3-self-other-line3-point3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_intersection_point3(self, other: Line3) -> Point3< / code > < a class = "header-anchor" href = "#method-cal-intersection-point3-self-other-line3-point3" aria-label = "Permalink to "***method*** `cal_intersection_point3(self, other: Line3) -> Point3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算平面与直线的交点。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > : 交点< / p > < p > < strong > Raises< / strong > :< / p > < blockquote > < ul > < li > < a href = "https://docs.python.org/3/library/exceptions.html#ValueError" target = "_blank" rel = "noreferrer" > < code > ValueError< / code > < / a > 平面与直线平行或重合< / li > < / ul > < / blockquote > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L142" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_intersection_point3< / 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 >
2024-08-28 20:35:22 +08:00
< 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;" > .normal < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction < / 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;" > 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;" > ' The plane and the line are parallel or coincident.' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x, y, z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.get_parametric_equations()< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / 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;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.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;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.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;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.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;" > .d) < / 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;" > .a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction.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;" > .b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction.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;" > .c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction.z)< / span > < / span >
2024-09-06 15:44:53 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > Point3(x(t), y(t), z(t))< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-parallel-plane3-self-point-point3-plane3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_parallel_plane3(self, point: Point3) -> Plane3< / code > < a class = "header-anchor" href = "#method-cal-parallel-plane3-self-point-point3-plane3" aria-label = "Permalink to "***method*** `cal_parallel_plane3(self, point: Point3) -> Plane3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算平行于该平面且过指定点的平面。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > point (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 指定点< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > : 平面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L162" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_parallel_plane3< / 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;" > ' Plane3' < / 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;" > Plane3.from_point_and_normal(point, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .normal)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-parallel-self-other-plane3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_parallel(self, other: Plane3) -> bool< / code > < a class = "header-anchor" href = "#method-is-parallel-self-other-plane3-bool" aria-label = "Permalink to "***method*** `is_parallel(self, other: Plane3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两个平面是否平行。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > ): 另一个平面< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否平行< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L172" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_parallel< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Plane3' < / 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:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .normal.is_parallel(other.normal)< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#property" target = "_blank" rel = "noreferrer" > < code > @property< / code > < / a > < / p > < h4 id = "method-normal-self-vector3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > normal(self) -> Vector3< / code > < a class = "header-anchor" href = "#method-normal-self-vector3" aria-label = "Permalink to "***method*** `normal(self) -> Vector3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 平面的法向量。< / p > < p > < strong > Return< / strong > : < a href = "./vector.html#class-vector3" > < code > Vector3< / code > < / a > : 法向量< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L183" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > property< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > normal< / 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 >
2024-09-06 15:44:53 +08:00
< 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;" > .a, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .b, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .c)< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#classmethod" target = "_blank" rel = "noreferrer" > < code > @classmethod< / code > < / a > < / p > < h4 id = "method-from-point-and-normal-cls-point-point3-normal-vector3-plane3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3< / code > < a class = "header-anchor" href = "#method-from-point-and-normal-cls-point-point3-normal-vector3-plane3" aria-label = "Permalink to "***method*** `from_point_and_normal(cls, point: Point3, normal: Vector3) -> Plane3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 工厂函数 由点和法向量构造平面(点法式构造)。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > point (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 平面上一点< / li > < li > normal (< a href = "./vector.html#class-vector3" > < code > Vector3< / code > < / a > ): 法向量< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > : 平面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L192" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > classmethod< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > from_point_and_normal< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (cls, point: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , normal: < / 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;" > ' Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > a, b, c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (normal.x, normal.y, normal.z)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > d < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / 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:#24292E;--shiki-dark:#E1E4E8;" > b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / 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:#24292E;--shiki-dark:#E1E4E8;" > c < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > point.z< / span > < / span >
2024-09-06 15:44:53 +08:00
< 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;" > (a, b, c, d)< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#classmethod" target = "_blank" rel = "noreferrer" > < code > @classmethod< / code > < / a > < / p > < h4 id = "method-from-three-points-cls-p1-point3-p2-point3-p3-point3-plane3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3< / code > < a class = "header-anchor" href = "#method-from-three-points-cls-p1-point3-p2-point3-p3-point3-plane3" aria-label = "Permalink to "***method*** `from_three_points(cls, p1: Point3, p2: Point3, p3: Point3) -> Plane3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 工厂函数 由三点构造平面。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > p1 (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 点1< / li > < li > p2 (< code > Point3< / code > ): 点2< / li > < li > p3 (< code > Point3< / code > ): 点3< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : 平面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L206" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > classmethod< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > from_three_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;" > , p3: < / 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;" > ' Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v1 < / 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:#24292E;--shiki-dark:#E1E4E8;" > v2 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > p3 < / 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:#24292E;--shiki-dark:#E1E4E8;" > normal < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v1.cross(v2)< / span > < / span >
2024-09-06 15:44:53 +08:00
< 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;" > .from_point_and_normal(p1, normal)< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#classmethod" target = "_blank" rel = "noreferrer" > < code > @classmethod< / code > < / a > < / p > < h4 id = "method-from-two-lines-cls-l1-line3-l2-line3-plane3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3< / code > < a class = "header-anchor" href = "#method-from-two-lines-cls-l1-line3-l2-line3-plane3" aria-label = "Permalink to "***method*** `from_two_lines(cls, l1: Line3, l2: Line3) -> Plane3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 工厂函数 由两直线构造平面。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > l1 (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 直线< / li > < li > l2 (< code > Line3< / code > ): 直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : 平面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L224" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > classmethod< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > from_two_lines< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (cls, l1: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , l2: < / 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;" > ' Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v1 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > l1.direction< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v2 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > l2.point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > l1.point< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v2 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > zero_vector3:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v2 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > l2.get_point(< / 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;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > l1.point< / span > < / span >
2024-09-06 15:44:53 +08:00
< 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;" > .from_point_and_normal(l1.point, v1.cross(v2))< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#classmethod" target = "_blank" rel = "noreferrer" > < code > @classmethod< / code > < / a > < / p > < h4 id = "method-from-point-and-line-cls-point-point3-line-line3-plane3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > from_point_and_line(cls, point: Point3, line: Line3) -> Plane3< / code > < a class = "header-anchor" href = "#method-from-point-and-line-cls-point-point3-line-line3-plane3" aria-label = "Permalink to "***method*** `from_point_and_line(cls, point: Point3, line: Line3) -> Plane3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 工厂函数 由点和直线构造平面。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > point (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 平面上一点< / li > < li > line (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : 平面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L240" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > classmethod< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > from_point_and_line< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (cls, point: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , line: < / 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;" > ' Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-06 19:59:45 +08:00
< 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;" > .from_point_and_normal(point, line.direction)< / span > < / span > < / code > < / pre > < / div > < / details > < p > < code > @overload< / code > < / p > < h4 id = "method-self-other-line3-point3-none" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > self & other: Line3 => Point3 | None< / code > < a class = "header-anchor" href = "#method-self-other-line3-point3-none" aria-label = "Permalink to "***method*** `self & other: Line3 => Point3 | None`"" > < / a > < / h4 > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L277" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @overload< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __and__< / 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 | None' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-06 19:59:45 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < / span > < / code > < / pre > < / div > < / details > < p > < code > @overload< / code > < / p > < h4 id = "method-self-other-plane3-line3-none" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > self & other: Plane3 => Line3 | None< / code > < a class = "header-anchor" href = "#method-self-other-plane3-line3-none" aria-label = "Permalink to "***method*** `self & other: Plane3 => Line3 | None`"" > < / a > < / h4 > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L281" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @overload< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __and__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3 | None' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-06 19:59:45 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-self-other" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > self & other< / code > < a class = "header-anchor" href = "#method-self-other" aria-label = "Permalink to "***method*** `self & other`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 取两平面的交集(人话:交线)< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > | < a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > ): 另一个平面或直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./line.html#class-line3" > < code > Line3< / code > < / a > | < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > | < a href = "https://docs.python.org/3/library/constants.html#None" target = "_blank" rel = "noreferrer" > < code > None< / code > < / a > : 交集< / p > < p > < strong > Raises< / strong > :< / p > < blockquote > < ul > < li > < a href = "https://docs.python.org/3/library/exceptions.html#TypeError" target = "_blank" rel = "noreferrer" > < code > TypeError< / code > < / a > 不支持的类型< / li > < / ul > < / blockquote > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L284" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __and__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other):< / span > < / span >
2024-08-28 20:35:22 +08:00
< 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, Plane3):< / 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;" > .normal.is_parallel(other.normal):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > None< / 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;" > .cal_intersection_line3(other)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (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:#24292E;--shiki-dark:#E1E4E8;" > .normal < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction < / 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:#005CC5;--shiki-dark:#79B8FF;" > None< / 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;" > .cal_intersection_point3(other)< / 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 >
2024-09-06 15:44:53 +08:00
< 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 operand type(s) for & : ' Plane3' 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 > < h4 id = "method-eq-self-other-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > __eq__(self, other) -> bool< / code > < a class = "header-anchor" href = "#method-eq-self-other-bool" aria-label = "Permalink to "***method*** `__eq__(self, other) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两个平面是否等价。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./plane.html#class-plane3" > < code > Plane3< / code > < / a > ): 另一个平面< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否等价< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L305" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __eq__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other) -> < / span > < span 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:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .approx(other)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-rand-self-other-line3-point3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > __rand__(self, other: Line3) -> Point3< / code > < a class = "header-anchor" href = "#method-rand-self-other-line3-point3" aria-label = "Permalink to "***method*** `__rand__(self, other: Line3) -> Point3`"" > < / a > < / h4 > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/plane.py#L315" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __rand__< / 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 >
2024-09-03 22:49:39 +08:00
< 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;" > .cal_intersection_point3(other)< / span > < / span > < / code > < / pre > < / div > < / details > < / div > < / div > < / main > < footer class = "VPDocFooter" data-v-01c90815 data-v-28deee4a > <!-- [ --> <!-- ] --> < div class = "edit-info" data-v-28deee4a > < div class = "edit-link" data-v-28deee4a > < a class = "VPLink link vp-external-link-icon no-icon edit-link-button" href = "https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/plane.py" target = "_blank" rel = "noreferrer" data-v-28deee4a > <!-- [ --> < span class = "vpi-square-pen edit-link-icon" data-v-28deee4a > < / span > Edit this page on GitHub<!-- ] --> < / a > < / div > <!-- --> < / div > < nav class = "prev-next" aria-labelledby = "doc-footer-aria-label" data-v-28deee4a > < span class = "visually-hidden" id = "doc-footer-aria-label" data-v-28deee4a > Pager< / span > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link prev" href = "/en/api/mp_math/mp_math_typing.html" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > Prev Page< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math.mp_math_typing< / span > <!-- ] --> < / a > < / div > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link next" href = "/en/api/mp_math/point.html" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > Next Page< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math.point< / span > <!-- ] --> < / a > < / div > < / nav > < / footer > <!-- [ --> <!-- ] --> < / div > < / div > < / div > <!-- [ --> <!-- ] --> < / div > < / div > < footer class = "VPFooter has-sidebar" data-v-3b4648ff data-v-d69bcf5d > < div class = "container" data-v-d69bcf5d > < p class = "message" data-v-d69bcf5d > Documentation built with < a href = "https://vitepress.dev/" > VitePress< / a > | API references generated by < a href = "https://github.com/LiteyukiStudio/litedoc" > litedoc< / a > < / p > < p class = "copyright" data-v-d69bcf5d > Copyright (C) 2020-2024 SnowyKami. All Rights Reserved< / p > < / div > < / footer > <!-- [ --> <!-- ] --> < / div > < / div >
2024-09-06 19:59:45 +08:00
< script > w i n d o w . _ _ V P _ H A S H _ M A P _ _ = J S O N . p a r s e ( " { \ " a p i _ i n d e x . m d \ " : \ " B O 3 O G C Z m \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D R C L N U J L \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B _ A P a Y - d \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " Q 6 t f q P V 1 \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C D W 7 K 4 a O \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B f S A i 6 Y B \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " l C Q R k Z t k \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D 0 j H a H h o \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " 2 Z c l J A 1 V \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C 4 s 5 F h w G \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " J Y V g L e p k \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " D u X Z d _ E C \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " F C - q e 2 - I \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B n a J l v r B \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C n 3 t b i U 4 \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D T Q N H o Y w \ " , \ " d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m Y j f r x d \ " , \ " d e m o _ i n d e x . m d \ " : \ " C V A d l a F I \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " C 0 - L R r M B \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B d _ S m d d I \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " f - 2 w Q H W 5 \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B 0 T h T N c D \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " l 1 9 F Y 4 H u \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B i D C W h u z \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " D F w E 8 l l X \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " A 2 o A W I N P \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C B N C e D F 4 \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " D r 2 b D E 6 - \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D 0 w p X 8 U s \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " n 9 H k x c _ q \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " A R D Q G W R k \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " j 3 _ p 5 K t Y \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B j 8 H Q N _ s \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " C F 6 g W x h r \ " , \ " e n _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m t Y 1 0 5 n \ " , \ " e n _ g u i d e _ i n d e x . m d \ " : \ " C 3 k I 8 f 8 A \ " , \ " e n _ i n d e x . m d \ " : \ " C c - N t 9 O t \ " , \ " e n _ r e f e r _ i n d e x . m d \ " : \ " C q 6 G W i 0 V \ " , \ " g u i d e _ i n d e x . m d \ " : \ " C J O q v l S E \ " , \ " i n d e x . m d \ " : \ " W V p b C 1 C 1 \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " C G n g N E P X \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D u r F o q A y \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " k K A d 6 i h V \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C l A C M t E E \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " p J M 1 N J 2 m \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B C R e R K f D \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C M c k w G p V \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " C z E P V 5 E p \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D 5 4 9 k B N 0 \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C e v h X W s h \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D Z A k m I j J \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B k 8 M H g O d \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " c 1 m t K a M 8 \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C W 1 r q a r C \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B F c _ P f J b \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " w Z Z U h v v V \ " , \ " j a _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C B H i F 6 e c \ " , \ " j a _ g u i d e _ i n d e x . m d \ " : \ " w 1 T f 2 A d m \ " , \ " j a _ i n d e x . m d \ " : \ " B v j V 8 R I J \ " , \ " j a _ r e f e r _ i n d e x . m d \ " : \ " D a m U s c s 8 \ " , \ " r e f e r _ 7 - d i f f e r e n t i a l - e u q t i o n _ i n d e x . m d \ " : \ " D d 2 - 7 I 9 S \ " , \ " r e f e r _ f u n c t i o n _ c u r r y . m d \ " : \ " D _ o q R D d 3 \ " , \ " r e f e r _ f u n c t i o n _ f u n c t i o n . m d \ " : \ " B i _ 8 2 l I J \ " , \ " r e f e r _ i n d e x . m d \ " : \ " y F Z W 0 k I 4 \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " B h 7 I C G 6 U \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " C B K E Z c i J \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D 9 e B w c N w \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D c k V 9 F 7 F \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " 3 R r u 8 v f k \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D V q L R Z h m \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B m X i O e C t \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D W z R f F J e \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D Y h 8 1 - Y I \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " D o Q 3 5 q 2 6 \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C q Q i t A R a \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " i t N F G 1 x 8 \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " D u g 1 h q A u \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " b d o u G 1 s k \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " 9 w d P A k K N \ " , \ " z h t _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B f m F W G a - \ " , \ " z h t _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C P N b D _ L g \ " , \ " z h t _ g u i d e _ i n d e x . m d \ " : \ " B N n M V i C 8 \ " , \ " z h t _ i n d e x . m d \ " : \ " f k O Y k Z Z e \ " , \ " z h t _ r e f e r _ i n d e x . m d \ " : \ " B 7 C Q S 2 U W \ " } " ) ; f u n c t i o n d e s e r i a l i z e F u n c t i o n s ( r ) { r e t u r n A r r a y . i s A r r a y ( r ) ? r . m a p ( d e s e r i a l i z e F u n c t i o n s ) : t y p e o f r = = " o b j e c t " & & r ! = = n u l l ? O b j e c t . k e y s ( r ) . r e d u c e ( ( t , n ) = > ( t [ n ] = d e s e r i a l i z e F u n c t i o n s ( r [ n ] ) , t ) , { } ) : t y p e o f r = = " s t r i n g " & & r . s t a r t s W i t h ( " _ v p - f n _ " ) ? n e w F u n c t i o n ( ` r e t u r n $ { r . s l i c e ( 7 ) } ` ) ( ) : r } ; w i n d o w . _ _ V P _ S I T E _ D A T A _ _ = d e s e r i a l i z e F u n c t i o n s ( J S O N . p a r s e ( " { \ " l a n g \ " : \ " e n - U S \ " , \ " d i r \ " : \ " l t r \ " , \ " t i t l e \ " : \ " V i t e P r e s s \ " , \ " d e s c r i p t i o n \ " : \ " A V i t e P r e s s s i t e \ " , \ " b a s e \ " : \ " / \ " , \ " h e a d \ " : [ ] , \ " r o u t e r \ " : { \ " p r e f e t c h L i n k s \ " : t r u e } , \ " a p p e a r a n c e \ " : t r u e , \ " t h e m e C o n f i g \ " : { \ " l o g o \ " : \ " / m b c p - l o g o . s v g \ " , \ " s i d e b a r \ " : { \ " / a p i / \ " : { \ " b a s e \ " : \ " / a p i / \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " M B C P \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m p _ m a t h \ " , \ " i t
2024-08-28 20:35:22 +08:00
< / body >
< / html >