Unit¶
- class manim_eng.units.Unit(symbol: str, latex: str | None = None, exponent: int | float = 1, prefix: bool = False)¶
Bases:
objectAn SI unit or prefix.
- Parameters:
symbol (str) – The symbol of the unit. For metres this would be ‘m’.
latex (str, optional) – The latex math mode code to present the unit symbol. If not given, defaults to
symbol.exponent (int | float, optional) – The exponent of the unit (e.g. 2 for \(m^{2}\)). Defaults to 1 if unspecified.
prefix (bool, optional) – Whether the symbol is that of a prefix (e.g. ‘k’ for ‘kilo’) or that of a unit. Defaults to
Falseif unspecified.
- to_latex() str¶
Return a LaTeX math mode string representation of the unit.