0.0.1 • Published 4 years ago

timusoid v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

timusoid

Circular representations of time. These are useful for graphically representing the periodicity of time or representing time-dependent input behaviour in deep neural networks. This was inspired by @ItsIanLondon's article "Encoding Cyclical Features in 24 Hour Time".

🚀 Getting Started

Using npm:

npm install --save timusoid

Using yarn:

yarn add timusoid

✍️ Usage

import moment from 'moment';
import { timusoid } from 'timusoid';

const { sin, cos, tan, progress } = timusoid(
  moment('2020-01-04T14:19:03.201Z'),
  'yearly', // oneOf(['hourly', 'daily', 'weekly', 'monthly', 'yearly'])
);

sin(); // 0.061703628813687975
cos(); // 0.9980945156603269
tan(); // 0.061821428577699
progress(); // 0.009826679853832305 (%)

✌️ License

MIT