Skip to main content

Function: distanceLabel()

distanceLabel(from, to, options): Group

Defined in: src/mobjects/molecular/annotations.ts:180

A measured line between two points plus a billboarded distance label.

The label text is the computed distance |to - from|, formatted with decimals places and the unit, unless label overrides it. The returned group's first child is the line and its last child is the Text label, which the caller billboards with scene.addFixedOrientationMobjects(...).

Parameters​

from​

Vector3Tuple

The first point.

to​

Vector3Tuple

The second point.

options​

DistanceLabelOptions = {}

Label and line styling.

Returns​

Group

A Group of [line, label].