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

模組 mbcp.mp_math.angle

本模块定义了角度相关的类

class Angle

class AnyAngle(Angle)

method __init__(self, value: float, is_radian: bool = False)

説明: 任意角度。

變數説明:

源碼於GitHub上查看
python
def __init__(self, value: float, is_radian: bool=False):\n    if is_radian:\n        self.radian = value\n    else:\n        self.radian = value * PI / 180

@property

method complementary(self) -> AnyAngle

説明: 余角:两角的和为90°。

返回: 余角

源碼於GitHub上查看
python
@property\ndef complementary(self) -> 'AnyAngle':\n    return AnyAngle(PI / 2 - self.minimum_positive.radian, is_radian=True)

@property

method supplementary(self) -> AnyAngle

説明: 补角:两角的和为180°。

返回: 补角

源碼於GitHub上查看
python
@property\ndef supplementary(self) -> 'AnyAngle':\n    return AnyAngle(PI - self.minimum_positive.radian, is_radian=True)

@property

method degree(self) -> float

説明: 角度。

返回: 弧度

源碼於GitHub上查看
python
@property\ndef degree(self) -> float:\n    return self.radian * 180 / PI

@property

method minimum_positive(self) -> AnyAngle

説明: 最小正角。

返回: 最小正角度

源碼於GitHub上查看
python
@property\ndef minimum_positive(self) -> 'AnyAngle':\n    return AnyAngle(self.radian % (2 * PI))

@property

method maximum_negative(self) -> AnyAngle

説明: 最大负角。

返回: 最大负角度

源碼於GitHub上查看
python
@property\ndef maximum_negative(self) -> 'AnyAngle':\n    return AnyAngle(-self.radian % (2 * PI), is_radian=True)

@property

method sin(self) -> float

説明: 正弦值。

返回: 正弦值

源碼於GitHub上查看
python
@property\ndef sin(self) -> float:\n    return math.sin(self.radian)

@property

method cos(self) -> float

説明: 余弦值。

返回: 余弦值

源碼於GitHub上查看
python
@property\ndef cos(self) -> float:\n    return math.cos(self.radian)

@property

method tan(self) -> float

説明: 正切值。

返回: 正切值

源碼於GitHub上查看
python
@property\ndef tan(self) -> float:\n    return math.tan(self.radian)

@property

method cot(self) -> float

説明: 余切值。

返回: 余切值

源碼於GitHub上查看
python
@property\ndef cot(self) -> float:\n    return 1 / math.tan(self.radian)

@property

method sec(self) -> float

説明: 正割值。

返回: 正割值

源碼於GitHub上查看
python
@property\ndef sec(self) -> float:\n    return 1 / math.cos(self.radian)

@property

method csc(self) -> float

説明: 余割值。

返回: 余割值

源碼於GitHub上查看
python
@property\ndef csc(self) -> float:\n    return 1 / math.sin(self.radian)

method self + other: AnyAngle => AnyAngle

源碼於GitHub上查看
python
def __add__(self, other: 'AnyAngle') -> 'AnyAngle':\n    return AnyAngle(self.radian + other.radian, is_radian=True)

method self == other

源碼於GitHub上查看
python
def __eq__(self, other):\n    return approx(self.radian, other.radian)

method self - other: AnyAngle => AnyAngle

源碼於GitHub上查看
python
def __sub__(self, other: 'AnyAngle') -> 'AnyAngle':\n    return AnyAngle(self.radian - other.radian, is_radian=True)

method self * other: float => AnyAngle

源碼於GitHub上查看
python
def __mul__(self, other: float) -> 'AnyAngle':\n    return AnyAngle(self.radian * other, is_radian=True)

@overload

method self / other: float => AnyAngle

源碼於GitHub上查看
python
@overload\ndef __truediv__(self, other: float) -> 'AnyAngle':\n    ...

@overload

method self / other: AnyAngle => float

源碼於GitHub上查看
python
@overload\ndef __truediv__(self, other: 'AnyAngle') -> float:\n    ...

method self / other

源碼於GitHub上查看
python
def __truediv__(self, other):\n    if isinstance(other, AnyAngle):\n        return self.radian / other.radian\n    return AnyAngle(self.radian / other, is_radian=True)
',80),h=[n];function l(p,k,r,o,d,g){return i(),a("div",null,h)}const c=s(e,[["render",l]]);export{m as __pageData,c as default};