Reference · The Sun, Moon and planets: pure parts
blendfunction
A frame between two others, t from 0 to 1. The spin goes the short way round, so a step under half a turn is right.
Import it
import { blend } from "@johnmorrisdotca/chikyu-earth/space";
Definition
function blend(a: Frame, b: Frame, t: number): Frame
Parameters
| Name | Type | Description |
|---|---|---|
a | Frame | The earlier frame. |
b | Frame | The later frame. |
t | number | How far from |
Returns
Frame
The frame at that fraction.
Examples
import { blend, frameAt } from "@johnmorrisdotca/chikyu-earth/space";
const start = Date.UTC(2026, 10, 2);
const middle = blend(frameAt(start), frameAt(start + 1000), 0.5);
console.log(middle.ms - start);500What it prints (run when this page was built)