import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.DpC1ZpOZ.js";const m=JSON.parse('{"title":"mbcp.mp_math.segment","description":"","frontmatter":{"title":"mbcp.mp_math.segment","lastUpdated":false},"headers":[],"relativePath":"api/mp_math/segment.md","filePath":"zh/api/mp_math/segment.md"}'),n={name:"api/mp_math/segment.md"},h=t(`

模块 mbcp.mp_math.segment

本模块定义了三维空间中的线段类

class Segment3

method __init__(self, p1: Point3, p2: Point3)

说明: 三维空间中的线段。

参数:

源代码在GitHub上查看
python
def __init__(self, p1: 'Point3', p2: 'Point3'):
    self.p1 = p1
    self.p2 = p2
    '方向向量'
    self.direction = self.p2 - self.p1
    '长度'
    self.length = self.direction.length
    '中心点'
    self.midpoint = Point3((self.p1.x + self.p2.x) / 2, (self.p1.y + self.p2.y) / 2, (self.p1.z + self.p2.z) / 2)
`,8),p=[h];function e(l,k,r,d,E,g){return a(),i("div",null,p)}const c=s(n,[["render",e]]);export{m as __pageData,c as default};