Skip to the content

Uchusen Rockets宇宙船

Rockets drawn from sourced sizes: line drawings and painted 3D views you drop into a page, take apart and turn round, and a typed model that checks whether a rocket really goes together.

Uchusen is the Japanese word 宇宙船 for spaceship. About the name

Contents

Reference · Rockets, variants, parts and the fit check

pixelRatioForfunction

The device pixel ratio to draw a width x height view at: the screen's own, held to 2, to 4096 pixels a side and to 6 million in all. At least 0.25, and 1 for a nonsense value.

Import it

import { pixelRatioFor } from "@johnmorrisdotca/uchusen-rockets";

Definition

function pixelRatioFor(width: number, height: number, deviceRatio: number): number

Parameters

NameTypeDescription
widthnumber

The view's width in CSS pixels.

heightnumber

Its height in CSS pixels.

deviceRationumber

The screen's own pixel ratio.

Returns

number

The ratio to draw at.

Examples

import { pixelRatioFor } from "@johnmorrisdotca/uchusen-rockets";

console.log(pixelRatioFor(620, 827, 3), pixelRatioFor(3000, 3000, 2));
2 0.816496580927726

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/uchusen-rockets 0.14.0.