2024-08-28 20:35:22 +08:00
<!DOCTYPE html>
< html lang = "en-US" dir = "ltr" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
< title > mbcp.mp_math.line | MBCP docs< / title >
2024-08-31 06:08:36 +08:00
< meta name = "description" content = "MBCP library docs" >
2024-08-28 20:35:22 +08:00
< meta name = "generator" content = "VitePress v1.3.4" >
2024-09-07 00:44:54 +08:00
< link rel = "preload stylesheet" href = "/assets/style.Czi07tLB.css" as = "style" >
2024-08-28 20:35:22 +08:00
2024-09-07 02:39:42 +08:00
< script type = "module" src = "/assets/app.BuME1top.js" > < / script >
< link rel = "modulepreload" href = "/assets/chunks/theme.CjhjdGcl.js" >
2024-08-31 07:55:26 +08:00
< link rel = "modulepreload" href = "/assets/chunks/framework.DpC1ZpOZ.js" >
2024-09-07 02:39:42 +08:00
< link rel = "modulepreload" href = "/assets/en_api_mp_math_line.md.DNsCS4Aa.lean.js" >
2024-08-31 06:08:36 +08:00
< link rel = "icon" type = "image/svg+xml" href = "/mbcp-logo.svg" >
2024-08-31 07:31:49 +08:00
< link rel = "stylesheet" href = "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" >
2024-08-28 20:35:22 +08:00
< script id = "check-dark-mode" > ( ( ) => { const e = localStorage . getItem ( "vitepress-theme-appearance" ) || "auto" , a = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ; ( ! e || e === "auto" ? a : e === "dark" ) && document . documentElement . classList . add ( "dark" ) } ) ( ) ; < / script >
< script id = "check-mac-os" > document . documentElement . classList . toggle ( "mac" , /Mac|iPhone|iPod|iPad/i . test ( navigator . platform ) ) ; < / script >
< / head >
< body >
2024-09-04 19:22:16 +08:00
< div id = "app" > < div class = "Layout" data-v-3b4648ff > <!-- [ --> <!-- ] --> <!-- [ --> < span tabindex = "-1" data-v-e813112c > < / span > < a href = "#VPContent" class = "VPSkipLink visually-hidden" data-v-e813112c > Skip to content < / a > <!-- ] --> <!-- --> < header class = "VPNav" data-v-3b4648ff data-v-e823d444 > < div class = "VPNavBar has-sidebar top" data-v-e823d444 data-v-da0688be > < div class = "wrapper" data-v-da0688be > < div class = "container" data-v-da0688be > < div class = "title" data-v-da0688be > < div class = "VPNavBarTitle has-sidebar" data-v-da0688be data-v-606a7e0f > < a class = "title" href = "/en/" data-v-606a7e0f > <!-- [ --> <!-- ] --> <!-- [ --> < img class = "VPImage logo" src = "/mbcp-logo.svg" alt data-v-cc63e071 > <!-- ] --> < span data-v-606a7e0f > MBCP docs< / span > <!-- [ --> <!-- ] --> < / a > < / div > < / div > < div class = "content" data-v-da0688be > < div class = "content-body" data-v-da0688be > <!-- [ --> <!-- ] --> < div class = "VPNavBarSearch search" data-v-da0688be > <!-- [ --> <!-- --> < div id = "local-search" > < button type = "button" class = "DocSearch DocSearch-Button" aria-label = "Search" > < span class = "DocSearch-Button-Container" > < span class = "vp-icon DocSearch-Search-Icon" > < / span > < span class = "DocSearch-Button-Placeholder" > Search< / span > < / span > < span class = "DocSearch-Button-Keys" > < kbd class = "DocSearch-Button-Key" > < / kbd > < kbd class = "DocSearch-Button-Key" > K< / kbd > < / span > < / button > < / div > <!-- ] --> < / div > < nav aria-labelledby = "main-nav-aria-label" class = "VPNavBarMenu menu" data-v-da0688be data-v-bf53b681 > < span id = "main-nav-aria-label" class = "visually-hidden" data-v-bf53b681 > Main Navigation < / span > <!-- [ --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/guide/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Get Start< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/refer.html" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Reference< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/api/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > API Reference< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/en/demo/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > Demo< / span > <!-- ] --> < / a > <!-- ] --> <!-- ] --> < / nav > < div class = "VPFlyout VPNavBarTranslations translations" data-v-da0688be data-v-912817b1 data-v-00660109 > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "Change language" data-v-00660109 > < span class = "text" data-v-00660109 > < span class = "vpi-languages option-icon" data-v-00660109 > < / span > <!-- --> < span class = "vpi-chevron-down text-icon" data-v-00660109 > < / span > < / span > < / button > < div class = "menu" data-v-00660109 > < div class = "VPMenu" data-v-00660109 data-v-809b8af7 > <!-- --> <!-- [ --> <!-- [ --> < div class = "items" data-v-912817b1 > < p class = "title" data-v-912817b1 > English< / p > <!-- [ --> < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/api/mp_math/line.html" data-v-25a54821 > <!-- [ --> 简体中文<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/ja/api/mp_math/line.html" data-v-25a54821 > <!-- [ --> 日本語<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/zht/api/mp_math/line.html" data-v-25a54821 > <!-- [ --> 繁體中文<!-- ] --> < / a > < / div > <!-- ] --> < / div > <!-- ] --> <!-- ] --> < / div > < / div > < / div > < div class = "VPNavBarAppearance appearance" data-v-da0688be data-v-864d2abc > < button class = "VPSwitch VPSwitchAppearance" type = "button" role = "switch" title = "Switch to dark theme" aria-checked = "false" data-v-864d2abc data-v-3125216b data-v-846fe538 > < span class = "check" data-v-846fe538 > < span class = "icon" data-v-846fe538 > <!-- [ --> < span class = "vpi-sun sun" data-v-3125216b > < / span > < span class = "vpi-moon moon" data-v-3125216b > < / span > <!-- ] --> < / span > < / span > < / button > < / div > < div class = "VPSocialLinks VPNavBarSocialLinks social-links" data-v-da0688be data-v-2c606308 data-v-100434c4 > <!-- [ --> < a class = "VPSocialLink no-icon" href = "https://github.com/snowykami/mbcp" aria-label = "github" target = "_blank" rel = "noopener"
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > point< / span > < / span >
2024-09-03 22:49:39 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > direction< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-approx-self-other-line3-epsilon-float-approx-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > approx(self, other: Line3, epsilon: float = APPROX) -> bool< / code > < a class = "header-anchor" href = "#method-approx-self-other-line3-epsilon-float-approx-bool" aria-label = "Permalink to "***method*** `approx(self, other: Line3, epsilon: float = APPROX) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否近似相等。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < li > epsilon (< a href = "https://docs.python.org/3/library/functions.html#float" target = "_blank" rel = "noreferrer" > < code > float< / code > < / a > ): 误差< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否近似相等< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L29" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > approx< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , epsilon: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > float< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > APPROX< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_approx_parallel(other, epsilon) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point).is_approx_parallel(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction, epsilon)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-angle-self-other-line3-anyangle" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_angle(self, other: Line3) -> AnyAngle< / code > < a class = "header-anchor" href = "#method-cal-angle-self-other-line3-anyangle" aria-label = "Permalink to "***method*** `cal_angle(self, other: Line3) -> AnyAngle`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算直线和直线之间的夹角。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./angle.html#class-anyangle" > < code > AnyAngle< / code > < / a > : 夹角< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L40" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_angle< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' AnyAngle' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-07 02:39:42 +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;" > .direction.cal_angle(other.direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-distance-self-other-line3-point3-float" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_distance(self, other: Line3 | Point3) -> float< / code > < a class = "header-anchor" href = "#method-cal-distance-self-other-line3-point3-float" aria-label = "Permalink to "***method*** `cal_distance(self, other: Line3 | Point3) -> float`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算直线和直线或点之间的距离。< / p > < div class = "tip custom-block" > < p class = "custom-block-title" > TIP< / p > < p > 直线和直线之间的距离计算公式:< / p > < ul > < li > 平行/重合 = 0< / li > < li > 平行/异面 = < mjx-container class = "MathJax" jax = "SVG" style = "direction:ltr;position:relative;" > < svg style = "overflow:visible;min-height:1px;min-width:1px;vertical-align:-1.391ex;" xmlns = "http://www.w3.org/2000/svg" width = "7.356ex" height = "4.296ex" role = "img" focusable = "false" viewBox = "0 -1284.3 3251.5 1899" aria-hidden = "true" > < g stroke = "currentColor" fill = "currentColor" stroke-width = "0" transform = "scale(1,-1)" > < g data-mml-node = "math" > < g data-mml-node = "mfrac" > < g data-mml-node = "mrow" transform = "translate(220,516.4) scale(0.707)" > < g data-mml-node = "mo" transform = "translate(0 -0.5)" > < path data-c = "7C" d = "M139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "TeXAtom" data-mjx-texclass = "ORD" transform = "translate(278,0)" > < g data-mml-node = "mover" > < g data-mml-node = "mrow" > < g data-mml-node = "msub" > < g data-mml-node = "mi" > < path data-c = "1D443" d = "M287 628Q287 635 230 637Q206 637 199 638T192 648Q192 649 194 659Q200 679 203 681T397 683Q587 682 600 680Q664 669 707 631T751 530Q751 453 685 389Q616 321 507 303Q500 302 402 301H307L277 182Q247 66 247 59Q247 55 248 54T255 50T272 48T305 46H336Q342 37 342 35Q342 19 335 5Q330 0 319 0Q316 0 282 1T182 2Q120 2 87 2T51 1Q33 1 33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM645 554Q645 567 643 575T634 597T609 619T560 635Q553 636 480 637Q463 637 445 637T416 636T404 636Q391 635 386 627Q384 621 367 550T332 412T314 344Q314 342 395 342H407H430Q542 342 590 392Q617 419 631 471T645 554Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mn" transform = "translate(675,-150) scale(0.707)" > < path data-c = "31" d = "M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z" style = "stroke-width:3;" > < / path > < / g > < / g > < g data-mml-node = "msub" transform = "translate(1078.6,0)" > < g data-mml-node = "mi" > < path data-c = "1D443" d = "M287 628Q287 635 230 637Q206 637 199 638T192 648Q192 649 194 659Q200 679 203 681T397 683Q587 682 600 680Q664 669 707 631T751 530Q751 453 685 389Q616 321 507 303Q500 302 402 301H307L277 182Q247 66 247 59Q247 55 248 54T255 50T272 48T305 46H336Q342 37 342 35Q342 19 335 5Q330 0 319 0Q316 0 282 1T182 2Q120 2 87 2T51 1Q33 1 33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM645 554Q645 567 643 575T634 597T609 619T560 635Q553 636 480 637Q463 637 445 637T416 636T404 636Q391 635 386 627Q384 621 367 550T332 412T314 344Q314 342 395 342H407H430Q542 342 590 392Q617 419 631 471T645 554Z" style = "stroke-width:3;" > < / path > < / g > < g data-mml-node = "mn" transform = "translate(675,-150) scale(0.707)" > < path data-c = "32" d = "M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 6
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (other, Line3):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_parallel(other):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (other.point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point).cross(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction).length < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.length< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > not< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_coplanar(other):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > abs< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(other.direction) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(other.direction).length)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (other, Point3):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (other < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point).cross(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction).length < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.length< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-07 02:39:42 +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:#032F62;--shiki-dark:#9ECBFF;" > ' Unsupported type.' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-intersection-self-other-line3-point3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_intersection(self, other: Line3) -> Point3< / code > < a class = "header-anchor" href = "#method-cal-intersection-self-other-line3-point3" aria-label = "Permalink to "***method*** `cal_intersection(self, other: Line3) -> Point3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算两条直线的交点。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > : 交点< / p > < p > < strong > Raises< / strong > :< / p > < blockquote > < ul > < li > < a href = "https://docs.python.org/3/library/exceptions.html#TypeError" target = "_blank" rel = "noreferrer" > < code > ValueError< / code > < / a > 直线平行< / li > < li > < code > ValueError< / code > 直线不共面< / li > < / ul > < / blockquote > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L92" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_intersection< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_parallel(other):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > raise< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ValueError< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Lines are parallel and do not intersect.' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > not< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_coplanar(other):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > raise< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ValueError< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Lines are not coplanar and do not intersect.' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span >
2024-09-07 02:39:42 +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;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(other.direction) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.direction.cross(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(other.direction).length < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > **< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-cal-perpendicular-self-point-point3-line3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > cal_perpendicular(self, point: Point3) -> Line3< / code > < a class = "header-anchor" href = "#method-cal-perpendicular-self-point-point3-line3" aria-label = "Permalink to "***method*** `cal_perpendicular(self, point: Point3) -> Line3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算直线经过指定点p的垂线。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > point (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 指定点< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./line.html#class-line3" > < code > Line3< / code > < / a > : 垂线< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L110" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cal_perpendicular< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, point: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > Line3(point, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point))< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-get-point-self-t-realnumber-point3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > get_point(self, t: RealNumber) -> Point3< / code > < a class = "header-anchor" href = "#method-get-point-self-t-realnumber-point3" aria-label = "Permalink to "***method*** `get_point(self, t: RealNumber) -> Point3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 获取直线上的点。同一条直线, 但起始点和方向向量不同, 则同一个t对应的点不同。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > t (< a href = "./mp_math_typing.html#var-realnumber" > < code > RealNumber< / code > < / a > ): 参数t< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > : 点< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L120" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > get_point< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, t: RealNumber) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-get-parametric-equations-self-tuple-onesinglevarfunc-onesinglevarfunc-onesinglevarfunc" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]< / code > < a class = "header-anchor" href = "#method-get-parametric-equations-self-tuple-onesinglevarfunc-onesinglevarfunc-onesinglevarfunc" aria-label = "Permalink to "***method*** `get_parametric_equations(self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 获取直线的参数方程。< / p > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/stdtypes.html#tuple" target = "_blank" rel = "noreferrer" > < code > tuple< / code > < / a > [< a href = "./mp_math_typing.html#var-onesinglevarfunc" > < code > OneSingleVarFunc< / code > < / a > , < code > OneSingleVarFunc< / code > , < code > OneSingleVarFunc< / code > ]: 参数方程< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L130" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > get_parametric_equations< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self) -> tuple[OneSingleVarFunc, OneSingleVarFunc, OneSingleVarFunc]:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > lambda< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > lambda< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > lambda< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-approx-parallel-self-other-line3-epsilon-float-1e-06-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool< / code > < a class = "header-anchor" href = "#method-is-approx-parallel-self-other-line3-epsilon-float-1e-06-bool" aria-label = "Permalink to "***method*** `is_approx_parallel(self, other: Line3, epsilon: float = 1e-06) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否近似平行。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < li > epsilon (< a href = "https://docs.python.org/3/library/functions.html#float" target = "_blank" rel = "noreferrer" > < code > float< / code > < / a > ): 误差< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否近似平行< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L140" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_approx_parallel< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , epsilon: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > float< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 1e-06< / span > < span style = "-
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.is_approx_parallel(other.direction, epsilon)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-parallel-self-other-line3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_parallel(self, other: Line3) -> bool< / code > < a class = "header-anchor" href = "#method-is-parallel-self-other-line3-bool" aria-label = "Permalink to "***method*** `is_parallel(self, other: Line3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否平行。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否平行< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L151" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_parallel< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.is_parallel(other.direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-collinear-self-other-line3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_collinear(self, other: Line3) -> bool< / code > < a class = "header-anchor" href = "#method-is-collinear-self-other-line3-bool" aria-label = "Permalink to "***method*** `is_collinear(self, other: Line3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否共线。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否共线< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L161" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_collinear< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_parallel(other) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point).is_parallel(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-point-on-self-point-point3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_point_on(self, point: Point3) -> bool< / code > < a class = "header-anchor" href = "#method-is-point-on-self-point-point3-bool" aria-label = "Permalink to "***method*** `is_point_on(self, point: Point3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断点是否在直线上。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > point (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 点< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否在直线上< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L171" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_point_on< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, point: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point).is_parallel(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-is-coplanar-self-other-line3-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > is_coplanar(self, other: Line3) -> bool< / code > < a class = "header-anchor" href = "#method-is-coplanar-self-other-line3-bool" aria-label = "Permalink to "***method*** `is_coplanar(self, other: Line3) -> bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否共面。 充要条件: 两直线方向向量的叉乘与两直线上任意一点的向量的点积为0。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否共面< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L181" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > is_coplanar< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.cross(other.direction) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > @< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-simplify-self" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > simplify(self)< / code > < a class = "header-anchor" href = "#method-simplify-self" aria-label = "Permalink to "***method*** `simplify(self)`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 简化直线方程,等价相等。 自体简化,不返回值。< / p > < p > 按照可行性一次对x y z 化 0 处理,并对向量单位化< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L192" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > simplify< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self):< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.normalize()< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-07 02:39:42 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < / span > < / code > < / pre > < / div > < / details > < p > < a href = "https://docs.python.org/3/library/functions.html#classmethod" target = "_blank" rel = "noreferrer" > < code > @classmethod< / code > < / a > < / p > < h4 id = "method-from-two-points-cls-p1-point3-p2-point3-line3" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > from_two_points(cls, p1: Point3, p2: Point3) -> Line3< / code > < a class = "header-anchor" href = "#method-from-two-points-cls-p1-point3-p2-point3-line3" aria-label = "Permalink to "***method*** `from_two_points(cls, p1: Point3, p2: Point3) -> Line3`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 工厂函数 由两点构造直线。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > p1 (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 点1< / li > < li > p2 (< a href = "./point.html#class-point3" > < code > Point3< / code > < / a > ): 点2< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./line.html#class-line3" > < code > Line3< / code > < / a > : 直线< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L211" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > @< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > classmethod< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > from_two_points< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (cls, p1: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , p2: < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Point3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Line3' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > direction < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > p2 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > p1< / span > < / span >
2024-09-07 02:39:42 +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;" > (p1, direction)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-self-other-line3-line3-point3-none" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > self & other: Line3 => Line3 | Point3 | None< / code > < a class = "header-anchor" href = "#method-self-other-line3-line3-point3-none" aria-label = "Permalink to "***method*** `self & other: Line3 => Line3 | Point3 | None`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 计算两条直线点集合的交集。重合线返回自身, 平行线返回None, 交线返回交点。< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "./line.html#class-line3" > < code > Line3< / code > < / a > | < a href = "./point.html#class-point3" > < code > Point3< / code > < / a > | < a href = "https://docs.python.org/3/library/constants.html#None" target = "_blank" rel = "noreferrer" > < code > None< / code > < / a > : 交集< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L223" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __and__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other: < / span > < span 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;" > ' Line3 | Point3 | None' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-28 20:35:22 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_collinear(other):< / 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 >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_parallel(other) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > or< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > not< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .is_coplanar(other):< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > None< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-07 02:39:42 +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(other)< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "method-self-other-bool" tabindex = "-1" > < em > < strong > method< / strong > < / em > < code > self == other => bool< / code > < a class = "header-anchor" href = "#method-self-other-bool" aria-label = "Permalink to "***method*** `self == other => bool`"" > < / a > < / h4 > < p > < strong > Description< / strong > : 判断两条直线是否等价。< / p > < p > v1 // v2 ∧ (p1 - p2) // v1< / p > < p > < strong > Arguments< / strong > :< / p > < blockquote > < ul > < li > other (< a href = "./line.html#class-line3" > < code > Line3< / code > < / a > ): 另一条直线< / li > < / ul > < / blockquote > < p > < strong > Return< / strong > : < a href = "https://docs.python.org/3/library/functions.html#bool" target = "_blank" rel = "noreferrer" > < code > bool< / code > < / a > : 是否等价< / p > < details > < summary > < b > Source code< / b > or < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/line.py#L238" target = "_blank" > View on GitHub< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __eq__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, other) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > bool< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-09-03 22:49:39 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction.is_parallel(other.direction) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > and< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .point < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > other.point).is_parallel(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .direction)< / span > < / span > < / code > < / pre > < / div > < / details > < / div > < / div > < / main > < footer class = "VPDocFooter" data-v-01c90815 data-v-28deee4a > <!-- [ --> <!-- ] --> < div class = "edit-info" data-v-28deee4a > < div class = "edit-link" data-v-28deee4a > < a class = "VPLink link vp-external-link-icon no-icon edit-link-button" href = "https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/line.py" target = "_blank" rel = "noreferrer" data-v-28deee4a > <!-- [ --> < span class = "vpi-square-pen edit-link-icon" data-v-28deee4a > < / span > Edit this page on GitHub<!-- ] --> < / a > < / div > <!-- --> < / div > < nav class = "prev-next" aria-labelledby = "doc-footer-aria-label" data-v-28deee4a > < span class = "visually-hidden" id = "doc-footer-aria-label" data-v-28deee4a > Pager< / span > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link prev" href = "/en/api/mp_math/" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > Prev Page< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math< / span > <!-- ] --> < / a > < / div > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link next" href = "/en/api/mp_math/mp_math_typing.html" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > Next Page< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math.mp_math_typing< / span > <!-- ] --> < / a > < / div > < / nav > < / footer > <!-- [ --> <!-- ] --> < / div > < / div > < / div > <!-- [ --> <!-- ] --> < / div > < / div > < footer class = "VPFooter has-sidebar" data-v-3b4648ff data-v-d69bcf5d > < div class = "container" data-v-d69bcf5d > < p class = "message" data-v-d69bcf5d > Documentation built with < a href = "https://vitepress.dev/" > VitePress< / a > | API references generated by < a href = "https://github.com/LiteyukiStudio/litedoc" > litedoc< / a > < / p > < p class = "copyright" data-v-d69bcf5d > Copyright (C) 2020-2024 SnowyKami. All Rights Reserved< / p > < / div > < / footer > <!-- [ --> <!-- ] --> < / div > < / div >
2024-09-07 02:39:42 +08:00
< script > w i n d o w . _ _ V P _ H A S H _ M A P _ _ = J S O N . p a r s e ( " { \ " a p i _ i n d e x . m d \ " : \ " B O 3 O G C Z m \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " o 2 F j F J V M \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B _ A P a Y - d \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " 7 e Z h F p x b \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C D W 7 K 4 a O \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B f S A i 6 Y B \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " r T u T 8 q s Y \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D 0 j H a H h o \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B f K k Y q e h \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " 9 l Q O 7 e _ B \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " J Y V g L e p k \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B R g M K X y U \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B m t s l k k m \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B n a J l v r B \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C n 3 t b i U 4 \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D T Q N H o Y w \ " , \ " d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m Y j f r x d \ " , \ " d e m o _ i n d e x . m d \ " : \ " C V A d l a F I \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " C 0 - L R r M B \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B x I _ i o 2 D \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " f - 2 w Q H W 5 \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B D w 5 b o D N \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " l 1 9 F Y 4 H u \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B i D C W h u z \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " D N s C S 4 A a \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " A 2 o A W I N P \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " y S i w k B z T \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B t S 2 5 5 9 7 \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D 0 w p X 8 U s \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C - C O P C w _ \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " D J V 8 X i z 8 \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " j 3 _ p 5 K t Y \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B j 8 H Q N _ s \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " C F 6 g W x h r \ " , \ " e n _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m t Y 1 0 5 n \ " , \ " e n _ g u i d e _ i n d e x . m d \ " : \ " C 3 k I 8 f 8 A \ " , \ " e n _ i n d e x . m d \ " : \ " C c - N t 9 O t \ " , \ " e n _ r e f e r _ i n d e x . m d \ " : \ " C q 6 G W i 0 V \ " , \ " g u i d e _ i n d e x . m d \ " : \ " C J O q v l S E \ " , \ " i n d e x . m d \ " : \ " W V p b C 1 C 1 \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " C G n g N E P X \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B s V W 1 _ 4 5 \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " k K A d 6 i h V \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C v d c 0 k e i \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " p J M 1 N J 2 m \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B C R e R K f D \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " j O q N - t U X \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " C z E P V 5 E p \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D Y L G x 8 w T \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " g u j I o q h 8 \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D Z A k m I j J \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " c r O I c d W W \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " X t C c d 3 1 y \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C W 1 r q a r C \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B F c _ P f J b \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " w Z Z U h v v V \ " , \ " j a _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C B H i F 6 e c \ " , \ " j a _ g u i d e _ i n d e x . m d \ " : \ " w 1 T f 2 A d m \ " , \ " j a _ i n d e x . m d \ " : \ " B v j V 8 R I J \ " , \ " j a _ r e f e r _ i n d e x . m d \ " : \ " D a m U s c s 8 \ " , \ " r e f e r _ 7 - d i f f e r e n t i a l - e u q t i o n _ i n d e x . m d \ " : \ " D d 2 - 7 I 9 S \ " , \ " r e f e r _ f u n c t i o n _ c u r r y . m d \ " : \ " D _ o q R D d 3 \ " , \ " r e f e r _ f u n c t i o n _ f u n c t i o n . m d \ " : \ " B i _ 8 2 l I J \ " , \ " r e f e r _ i n d e x . m d \ " : \ " y F Z W 0 k I 4 \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " B h 7 I C G 6 U \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D K 9 u n 2 D h \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D 9 e B w c N w \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " U 4 J C w J w D \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " 3 R r u 8 v f k \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D V q L R Z h m \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B R A z c J 1 g \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D W z R f F J e \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C t s X v A x w \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C G q D e a E v \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C q Q i t A R a \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C F a s 0 P J L \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B n v y N B h C \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " b d o u G 1 s k \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " 9 w d P A k K N \ " , \ " z h t _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B f m F W G a - \ " , \ " z h t _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C P N b D _ L g \ " , \ " z h t _ g u i d e _ i n d e x . m d \ " : \ " B N n M V i C 8 \ " , \ " z h t _ i n d e x . m d \ " : \ " f k O Y k Z Z e \ " , \ " z h t _ r e f e r _ i n d e x . m d \ " : \ " B 7 C Q S 2 U W \ " } " ) ; f u n c t i o n d e s e r i a l i z e F u n c t i o n s ( r ) { r e t u r n A r r a y . i s A r r a y ( r ) ? r . m a p ( d e s e r i a l i z e F u n c t i o n s ) : t y p e o f r = = " o b j e c t " & & r ! = = n u l l ? O b j e c t . k e y s ( r ) . r e d u c e ( ( t , n ) = > ( t [ n ] = d e s e r i a l i z e F u n c t i o n s ( r [ n ] ) , t ) , { } ) : t y p e o f r = = " s t r i n g " & & r . s t a r t s W i t h ( " _ v p - f n _ " ) ? n e w F u n c t i o n ( ` r e t u r n $ { r . s l i c e ( 7 ) } ` ) ( ) : r } ; w i n d o w . _ _ V P _ S I T E _ D A T A _ _ = d e s e r i a l i z e F u n c t i o n s ( J S O N . p a r s e ( " { \ " l a n g \ " : \ " e n - U S \ " , \ " d i r \ " : \ " l t r \ " , \ " t i t l e \ " : \ " V i t e P r e s s \ " , \ " d e s c r i p t i o n \ " : \ " A V i t e P r e s s s i t e \ " , \ " b a s e \ " : \ " / \ " , \ " h e a d \ " : [ ] , \ " r o u t e r \ " : { \ " p r e f e t c h L i n k s \ " : t r u e } , \ " a p p e a r a n c e \ " : t r u e , \ " t h e m e C o n f i g \ " : { \ " l o g o \ " : \ " / m b c p - l o g o . s v g \ " , \ " s i d e b a r \ " : { \ " / a p i / \ " : { \ " b a s e \ " : \ " / a p i / \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " M B C P \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m p _ m a t h \ " , \ " i t
2024-08-28 20:35:22 +08:00
< / body >
< / html >