2024-08-28 12:03:02 +08:00
<!DOCTYPE html>
< html lang = "zh-Hans" dir = "ltr" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2024-08-28 20:35:22 +08:00
< title > mbcp.mp_math.plane | MBCP docs< / title >
2024-08-28 12:03:02 +08:00
< meta name = "description" content = "一个用于Minecraft粒子计算和生成的库" >
< meta name = "generator" content = "VitePress v1.3.4" >
< link rel = "preload stylesheet" href = "/assets/style.Bb0QBJmh.css" as = "style" >
< script type = "module" src = "/assets/app.l1Ut0uce.js" > < / script >
< link rel = "preload" href = "/assets/inter-roman-latin.Di8DUHzh.woff2" as = "font" type = "font/woff2" crossorigin = "" >
< link rel = "modulepreload" href = "/assets/chunks/theme.BPuUWxkA.js" >
< link rel = "modulepreload" href = "/assets/chunks/framework.BV61Qrc0.js" >
2024-08-29 15:05:43 +08:00
< link rel = "modulepreload" href = "/assets/api_mp_math_plane.md.DLB54RNP.lean.js" >
2024-08-28 12:03:02 +08:00
< script id = "check-dark-mode" > ( ( ) => { const e = localStorage . getItem ( "vitepress-theme-appearance" ) || "auto" , a = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ; ( ! e || e === "auto" ? a : e === "dark" ) && document . documentElement . classList . add ( "dark" ) } ) ( ) ; < / script >
< script id = "check-mac-os" > document . documentElement . classList . toggle ( "mac" , /Mac|iPhone|iPod|iPad/i . test ( navigator . platform ) ) ; < / script >
< / head >
< body >
2024-08-29 13:47:40 +08:00
< div id = "app" > < div class = "Layout" data-v-8e016544 > <!-- [ --> <!-- ] --> <!-- [ --> < span tabindex = "-1" data-v-efdf7a7d > < / span > < a href = "#VPContent" class = "VPSkipLink visually-hidden" data-v-efdf7a7d > Skip to content < / a > <!-- ] --> <!-- --> < header class = "VPNav" data-v-8e016544 data-v-0c3b3583 > < div class = "VPNavBar has-sidebar top" data-v-0c3b3583 data-v-af8d762d > < div class = "wrapper" data-v-af8d762d > < div class = "container" data-v-af8d762d > < div class = "title" data-v-af8d762d > < div class = "VPNavBarTitle has-sidebar" data-v-af8d762d data-v-73c882b0 > < a class = "title" href = "/" data-v-73c882b0 > <!-- [ --> <!-- ] --> <!-- --> < span data-v-73c882b0 > MBCP docs< / span > <!-- [ --> <!-- ] --> < / a > < / div > < / div > < div class = "content" data-v-af8d762d > < div class = "content-body" data-v-af8d762d > <!-- [ --> <!-- ] --> < div class = "VPNavBarSearch search" data-v-af8d762d > <!-- --> < / div > < nav aria-labelledby = "main-nav-aria-label" class = "VPNavBarMenu menu" data-v-af8d762d data-v-ae469694 > < span id = "main-nav-aria-label" class = "visually-hidden" data-v-ae469694 > Main Navigation < / span > <!-- [ --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/guide/" tabindex = "0" data-v-ae469694 data-v-4ca2fdac > <!-- [ --> < span data-v-4ca2fdac > 快速开始< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/api/" tabindex = "0" data-v-ae469694 data-v-4ca2fdac > <!-- [ --> < span data-v-4ca2fdac > API文档< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/demo/" tabindex = "0" data-v-ae469694 data-v-4ca2fdac > <!-- [ --> < span data-v-4ca2fdac > 实例< / span > <!-- ] --> < / a > <!-- ] --> <!-- ] --> < / nav > < div class = "VPFlyout VPNavBarTranslations translations" data-v-af8d762d data-v-ba521018 data-v-6d56b0ed > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "Change language" data-v-6d56b0ed > < span class = "text" data-v-6d56b0ed > < span class = "vpi-languages option-icon" data-v-6d56b0ed > < / span > <!-- --> < span class = "vpi-chevron-down text-icon" data-v-6d56b0ed > < / span > < / span > < / button > < div class = "menu" data-v-6d56b0ed > < div class = "VPMenu" data-v-6d56b0ed data-v-36a6a4be > <!-- --> <!-- [ --> <!-- [ --> < div class = "items" data-v-ba521018 > < p class = "title" data-v-ba521018 > 简体中文< / p > <!-- [ --> < div class = "VPMenuLink" data-v-ba521018 data-v-a9b5eada > < a class = "VPLink link" href = "/en/api/mp_math/plane.html" data-v-a9b5eada > <!-- [ --> English<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-ba521018 data-v-a9b5eada > < a class = "VPLink link" href = "/ja/api/mp_math/plane.html" data-v-a9b5eada > <!-- [ --> 日本語<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-ba521018 data-v-a9b5eada > < a class = "VPLink link" href = "/zht/api/mp_math/plane.html" data-v-a9b5eada > <!-- [ --> 繁體中文<!-- ] --> < / a > < / div > <!-- ] --> < / div > <!-- ] --> <!-- ] --> < / div > < / div > < / div > < div class = "VPNavBarAppearance appearance" data-v-af8d762d data-v-fd625bab > < button class = "VPSwitch VPSwitchAppearance" type = "button" role = "switch" title = "Switch to dark theme" aria-checked = "false" data-v-fd625bab data-v-38c704f2 data-v-793caf05 > < span class = "check" data-v-793caf05 > < span class = "icon" data-v-793caf05 > <!-- [ --> < span class = "vpi-sun sun" data-v-38c704f2 > < / span > < span class = "vpi-moon moon" data-v-38c704f2 > < / span > <!-- ] --> < / span > < / span > < / button > < / div > < div class = "VPSocialLinks VPNavBarSocialLinks social-links" data-v-af8d762d data-v-9b3d2141 data-v-0ada25a4 > <!-- [ --> < a class = "VPSocialLink no-icon" href = "https://github.com/snowykami/mbcp" aria-label = "github" target = "_blank" rel = "noopener" data-v-0ada25a4 data-v-36d54f99 > < span class = "vpi-social-github" / > < / a > <!-- ] --> < / div > < div class = "VPFlyout VPNavBarExtra extra" data-v-af8d762d data-v-8ac0e455 data-v-6d56b0ed > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "extra navigation" data-v-6d56b0ed > < span class = "vpi-more-horizontal icon" data-v-6d56b0ed > < / span > < / button > < div class = "menu" data-v-6d56b0ed > < div class = "VPMenu" data-v-6d56b0ed data-v-36a6a4be > <!-- --> <!-- [ --> <!-- [ --> < div class = "group translations" data-v-8ac0e455 > < p class = "trans-title" data-v-8ac0e455 > 简体中文< / p > <!-- [ --> < div class = "VPMenuLink" data-v-8ac0e455 data-v-a9b5eada > < a class = "VPLink link" h
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面方程: ax + by + cz + d = 0< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
2024-08-29 13:25:00 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > a: x系数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > b: y系数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > c: z系数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > d: 常数项< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .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-08-29 15:05:43 +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 > < h3 id = "method-approx-self-other-plane3-bool" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 判断两个平面是否近似相等。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 另一个平面< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 是否近似相等< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 判断两个平面是否近似相等。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
2024-08-29 13:25:00 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 另一个平面< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 是否近似相等< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#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-08-29 15:05:43 +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 > < h3 id = "method-cal-angle-self-other-line3-plane3-anyangle" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 计算平面与平面之间的夹角。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 另一个平面< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 夹角弧度< / p > < p > < strong > 引发< / strong > :< / p > < blockquote > < ul > < li > TypeError 不支持的类型< / li > < / ul > < / blockquote > < details > < summary > < b > 源代码< / b > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_angle< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3 | Plane3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' AnyAngle' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算平面与平面之间的夹角。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 另一个平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 夹角弧度< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Raises:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > TypeError: 不支持的类型< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > 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-08-29 15:05:43 +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 > < h3 id = "method-cal-distance-self-other-plane3-point3-float" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 计算平面与平面或点之间的距离。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 另一个平面或点< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 距离< / p > < p > < strong > 引发< / strong > :< / p > < blockquote > < ul > < li > TypeError 不支持的类型< / li > < / ul > < / blockquote > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算平面与平面或点之间的距离。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 另一个平面或点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 距离< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Raises:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > TypeError: 不支持的类型< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > 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-08-29 15:05:43 +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 > < h3 id = "method-cal-intersection-line3-self-other-plane3-line3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 计算两平面的交线。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 另一个平面< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 两平面的交线< / p > < details > < summary > < b > 源代码< / b > < / 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_line3< / 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' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-29 13:25:00 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算两平面的交线。< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 另一个平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
2024-08-29 13:25:00 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 两平面的交线< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Raises:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / 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;" > 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-08-29 15:05:43 +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 > < h3 id = "method-cal-intersection-point3-self-other-line3-point3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 计算平面与直线的交点。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 不与平面平行或在平面上的直线< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 交点< / p > < p > < strong > 引发< / strong > :< / p > < blockquote > < ul > < li > ValueError 平面与直线平行或重合< / li > < / ul > < / blockquote > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算平面与直线的交点。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 不与平面平行或在平面上的直线< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 交点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Raises:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ValueError: 平面与直线平行或重合< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / 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;" > 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-08-29 15:05:43 +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 > < h3 id = "method-cal-parallel-plane3-self-point-point3-plane3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 计算平行于该平面且过指定点的平面。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > point: 指定点< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 所求平面< / p > < details > < summary > < b > 源代码< / b > < / 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 >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算平行于该平面且过指定点的平面。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > point: 指定点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
2024-08-29 13:25:00 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 所求平面< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-29 15:05:43 +08:00
< 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 > < h3 id = "method-is-parallel-self-other-plane3-bool" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 判断两个平面是否平行。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other: 另一个平面< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 是否平行< / p > < details > < summary > < b > 源代码< / b > < / 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 >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 判断两个平面是否平行。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other: 另一个平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 是否平行< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-29 13:47:40 +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;" > .normal.is_parallel(other.normal)< / span > < / span > < / code > < / pre > < / div > < / details > < h3 id = "property" tabindex = "-1" > < code > @property< / code > < a class = "header-anchor" href = "#property" aria-label = "Permalink to "`@property`"" > < / a > < / h3 > < h3 id = "method-normal-self-vector3" tabindex = "-1" > < em > method< / em > < code > normal(self) -> Vector3< / code > < a class = "header-anchor" href = "#method-normal-self-vector3" aria-label = "Permalink to "*method* `normal(self) -> Vector3`"" > < / a > < / h3 > < p > < strong > 说明< / strong > : 平面的法向量。< / p > < p > < strong > 返回< / strong > : 法向量< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +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 >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面的法向量。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 法向量< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-29 15:05:43 +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 > < h3 id = "classmethod" tabindex = "-1" > < code > @classmethod< / code > < a class = "header-anchor" href = "#classmethod" aria-label = "Permalink to "`@classmethod`"" > < / a > < / h3 > < h3 id = "method-from-point-and-normal-cls-point-point3-normal-vector3-plane3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 工厂函数 由点和法向量构造平面(点法式构造)。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > point: 平面上的一点< / li > < li > normal: 法向量< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 平面< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +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:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 工厂函数 由点和法向量构造平面(点法式构造)。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > point: 平面上的一点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > normal: 法向量< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > 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-08-29 15:05:43 +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 > < h3 id = "classmethod-1" tabindex = "-1" > < code > @classmethod< / code > < a class = "header-anchor" href = "#classmethod-1" aria-label = "Permalink to "`@classmethod`"" > < / a > < / h3 > < h3 id = "method-from-three-points-cls-p1-point3-p2-point3-p3-point3-plane3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 工厂函数 由三点构造平面。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > p1: 点1< / li > < li > p2: 点2< / li > < li > p3: 点3< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 平面< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +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:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 工厂函数 由三点构造平面。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > p1: 点1< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > p2: 点2< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > p3: 点3< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > 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-08-29 15:05:43 +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 > < h3 id = "classmethod-2" tabindex = "-1" > < code > @classmethod< / code > < a class = "header-anchor" href = "#classmethod-2" aria-label = "Permalink to "`@classmethod`"" > < / a > < / h3 > < h3 id = "method-from-two-lines-cls-l1-line3-l2-line3-plane3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 工厂函数 由两直线构造平面。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > l1: 直线1< / li > < li > l2: 直线2< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 平面< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +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:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 工厂函数 由两直线构造平面。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > l1: 直线1< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > l2: 直线2< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > 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-08-29 15:05:43 +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 > < h3 id = "classmethod-3" tabindex = "-1" > < code > @classmethod< / code > < a class = "header-anchor" href = "#classmethod-3" aria-label = "Permalink to "`@classmethod`"" > < / a > < / h3 > < h3 id = "method-from-point-and-line-cls-point-point3-line-line3-plane3" tabindex = "-1" > < em > method< / 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 > < / h3 > < p > < strong > 说明< / strong > : 工厂函数 由点和直线构造平面。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > point: 面上一点< / li > < li > line: 面上直线,不包含点< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 平面< / p > < details > < summary > < b > 源代码< / b > < / 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 12:03:02 +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 >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 工厂函数 由点和直线构造平面。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > point: 面上一点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > line: 面上直线,不包含点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 平面< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-29 13:47:40 +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 > < h3 id = "overload" tabindex = "-1" > < code > @overload< / code > < a class = "header-anchor" href = "#overload" aria-label = "Permalink to "`@overload`"" > < / a > < / h3 > < h3 id = "method-and-self-other-line3-point3-none" tabindex = "-1" > < em > method< / em > < code > __and__(self, other: Line3) -> Point3 | None< / code > < a class = "header-anchor" href = "#method-and-self-other-line3-point3-none" aria-label = "Permalink to "*method* `__and__(self, other: Line3) -> Point3 | None`"" > < / a > < / h3 > < details > < summary > < b > 源代码< / b > < / 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-08-29 13:47:40 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < / span > < / code > < / pre > < / div > < / details > < h3 id = "overload-1" tabindex = "-1" > < code > @overload< / code > < a class = "header-anchor" href = "#overload-1" aria-label = "Permalink to "`@overload`"" > < / a > < / h3 > < h3 id = "method-and-self-other-plane3-line3-none" tabindex = "-1" > < em > method< / em > < code > __and__(self, other: Plane3) -> Line3 | None< / code > < a class = "header-anchor" href = "#method-and-self-other-plane3-line3-none" aria-label = "Permalink to "*method* `__and__(self, other: Plane3) -> Line3 | None`"" > < / a > < / h3 > < details > < summary > < b > 源代码< / b > < / 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-08-29 15:05:43 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < / span > < / code > < / pre > < / div > < / details > < h3 id = "method-and-self-other" tabindex = "-1" > < em > method< / em > < code > __and__(self, other)< / code > < a class = "header-anchor" href = "#method-and-self-other" aria-label = "Permalink to "*method* `__and__(self, other)`"" > < / a > < / h3 > < p > < strong > 说明< / strong > : 取两平面的交集(人话:交线)< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > other:< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 不平行平面的交线, 平面平行返回None< / p > < details > < summary > < b > 源代码< / b > < / 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:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 取两平面的交集(人话:交线)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > other:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 不平行平面的交线, 平面平行返回None< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (other, 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-08-29 13:47:40 +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 > < h3 id = "method-eq-self-other-bool" tabindex = "-1" > < em > method< / 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 > < / h3 > < details > < summary > < b > 源代码< / b > < / 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 > < h3 id = "method-rand-self-other-line3-point3" tabindex = "-1" > < em > method< / 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 > < / h3 > < details > < summary > < b > 源代码< / b > < / 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-08-29 13:25:00 +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-aa782c77 data-v-f33b051d > <!-- [ --> <!-- ] --> <!-- --> < nav class = "prev-next" aria-labelledby = "doc-footer-aria-label" data-v-f33b051d > < span class = "visually-hidden" id = "doc-footer-aria-label" data-v-f33b051d > Pager< / span > < div class = "pager" data-v-f33b051d > < a class = "VPLink link pager-link prev" href = "/api/mp_math/mp_math_typing.html" data-v-f33b051d > <!-- [ --> < span class = "desc" data-v-f33b051d > Previous page< / span > < span class = "title" data-v-f33b051d > mbcp.mp_math.mp_math_typing< / span > <!-- ] --> < / a > < / div > < div class = "pager" data-v-f33b051d > < a class = "VPLink link pager-link next" href = "/api/mp_math/point.html" data-v-f33b051d > <!-- [ --> < span class = "desc" data-v-f33b051d > Next page< / span > < span class = "title" data-v-f33b051d > mbcp.mp_math.point< / span > <!-- ] --> < / a > < / div > < / nav > < / footer > <!-- [ --> <!-- ] --> < / div > < / div > < / div > <!-- [ --> <!-- ] --> < / div > < / div > <!-- --> <!-- [ --> <!-- ] --> < / div > < / div >
2024-08-29 15:05:43 +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 - e x . m d \ " : \ " D O s K a L 8 H \ " , \ " a p i _ i n d e x . m d \ " : \ " B v a z T q T B \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B 8 w 0 L P 6 o \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B z O Z u y Z q \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C k 1 9 t F k F \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " 4 P 0 h k 6 g b \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B 1 j A K P r 1 \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " B 0 O a W J m F \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D L B 5 4 R N P \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B w X a S b u z \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C 6 i 7 8 S T 1 \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B k x 3 Q J 6 f \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " E f t i 6 k d T \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B R C S x C 3 e \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " D l 6 S s 9 1 J \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D Y 6 Y M R q f \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " B g u - L D 1 B \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D m K _ A 9 x I \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " 6 y N m E o d n \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D y R N 0 j P I \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D r j D U Y B Y \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B B l z f l W h \ " , \ " 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 \ " : \ " B a 9 a Y P R 2 \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " c x y t Q L D 4 \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C X Q G h 5 Z t \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C x r e V g q R \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " a a v L L F M y \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B v K J E w 7 _ \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C m C 1 Q X 5 o \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C Z 5 h l _ 7 D \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D B f U Z U B C \ " , \ " g u i d e _ i n d e x . m d \ " : \ " B E 2 y l o i k \ " , \ " i n d e x . m d \ " : \ " B E 1 q C h T t \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " 4 B n f l F I m \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D x B e _ g 0 o \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C f l u t Y e A \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " 3 a 6 u m j d P \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " C S A M H Y s B \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C M f Q T 6 T H \ " , \ " 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 \ " : \ " B h y 6 h 0 r 0 \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C m 4 a 8 e q F \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C Q A I j H f b \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D 0 U 5 b M S u \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C X G q G L U s \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C 9 T t a y J k \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " E 2 Y n H 7 E N \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " A T G c H t 9 d \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D A V K 1 s D I \ " , \ " m d - e x . m d \ " : \ " B X 0 W q O q v \ " , \ " z h - h a n t _ a p i _ i n d e x . m d \ " : \ " D - i B k J b - \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " e K Q S p i M X \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B _ t Z 9 w L 7 \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D P i n r p 8 _ \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B 8 N L V 8 C f \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B - s 8 a L x Y \ " , \ " z h - h a n 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 O w D U O u 8 \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B 6 0 B z q 3 i \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B E s H V _ 8 G \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C - 4 e J k - Y \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " z 2 l M M p n T \ " , \ " z h - h a n t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " n 5 E f a e 6 D \ " , \ " z h - h a n t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B l d u I P t w \ " , \ " z h - h a n t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C D y g 8 7 e 9 \ " , \ " z h - h a n t _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D C H p j j Z _ \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " D q 4 X P U K Z \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " _ 4 N 1 9 G G e \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C I h A D r I 2 \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " 2 k - e E s 3 U \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D 0 9 y 2 u b g \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " 4 n c o P m k Z \ " , \ " 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 l x S o z R 9 \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B u k - S L c C \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B b 3 t y G v - \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " U _ l S 4 v U A \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " i g 9 j Q k o A \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C D y A X u J b \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " k A m 9 V A E w \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B m o u a E a T \ " , \ " 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 \ " : \ " C r d A y y C M \ " } " ) ; w i n d o w . _ _ V P _ S I T E _ D A T A _ _ = 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 \ " : \ " M B C P d o c s \ " , \ " d e s c r i p t i o n \ " : \ " M B C P l i b r a r y d o c s \ " , \ " 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 \ " : { \ " s o c i a l L i n k s \ " : [ { \ " i c o n \ " : \ " g i t h u b \ " , \ " l i n k \ " : \ " h t t p s : / / g i t h u b . c o m / s n o w y k a m i / m b c p \ " } ] , \ " s i d e b a r \ " : { \ " / a p i / \ " : [ { \ " t e x t \ " : \ " a p i \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m b c p \ " , \ " l i n k \ " : \ " / a p i / i n d e x . m d \ " } , { \ " t e x t \ " : \ " m p _ m a t h \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m b c p . m p _ m a t h \ " , \ " l i n k \ " : \ " / a p i / m p _ m a t h / i n d e x . m d \ " } , { \ " t e x t \ " : \ " m b c p . m p _ m a t h . a n g l e \ " , \ " l i n k \ " : \ " / a p i / m p _ m a t h / a n g l e . m d \ " } , { \ " t e x t \ " : \ " m b c p . m p _ m a t h . c o n s t \ " , \ " l i n k \ " : \ " / a p i / m p _ m a t h / c o n s t . m d \ " } , { \ " t e x t \ " : \ " m b c p . m p _ m a t h . e q u a t i o n \ " , \ " l i n k \ " : \ " / a p i / m p _ m a t h / e q u a t i o n . m d \ " } , { \ " t e x t \ " : \ " m b c p . m
2024-08-28 12:03:02 +08:00
< / body >
< / html >