old.nicco.io/utils/utils.ts

6 lines
227 B
TypeScript
Raw Permalink Normal View History

2020-01-05 17:34:03 +01:00
export const Rand = (from: number = 0, to: number = 1, float: boolean = false) => {
const rand = (Math.random() * (to - from)) + from
return float ? rand : rand | 0
}
export const GoldenRatio: number = (1 + Math.sqrt(5)) / 2