Reference · Rockets, variants, parts and the fit check
labelDensityfunction
How dense a ship's labels are: labels for each hundred metres, and the share of the length each label stands for. The target is one label for every 3 to 5% of the length.
Import it
import { labelDensity } from "@johnmorrisdotca/uchusen-rockets";
Definition
function labelDensity(ship: ShipList): { labels: number; perHundredMetres: number; shareEach: number; }
Parameters
| Name | Type | Description |
|---|---|---|
ship | ShipList | The ship's list. |
Returns
{ labels: number; perHundredMetres: number; shareEach: number; }
The count, labels for each hundred metres and the share of the length each label stands for.
Examples
import { labelDensity, SAMPLE_SHIPS } from "@johnmorrisdotca/uchusen-rockets";
console.log(labelDensity(SAMPLE_SHIPS.hauler));{
labels: 93,
perHundredMetres: 46.062407132243685,
shareEach: 0.010752688172043012
}What it prints (run when this page was built)