{"version":3,"file":"math.cjs","names":[],"sources":["../src/math/deg-to-rad.ts","../src/math/percent-from.ts","../src/math/rad-to-deg.ts"],"sourcesContent":["/**\n * Converts degrees to radians.\n *\n * @example\n * ```ts\n * degToRad(180); // Math.PI\n * ```\n */\nexport function degToRad(deg: number) {\n  return deg * (Math.PI / 180);\n}\n","import type { Maybe } from 'yummies/types';\n\n/**\n * Returns what percentage `value` is of `from`.\n * @example\n * ```ts\n * percentFrom(500, 2000) // 25\n * percentFrom(1000, 2000) // 50\n * ```\n */\nexport const percentFrom = (value: Maybe<number>, from: Maybe<number>) => {\n  return ((value ?? 0) / (from ?? 0)) * 100 || 0;\n};\n","/**\n * Converts radians to degrees.\n *\n * @example\n * ```ts\n * radToDeg(Math.PI); // 180\n * ```\n */\nexport function radToDeg(rad: number) {\n  return rad * (180 / Math.PI);\n}\n"],"mappings":";;;;;;;;;;AAQA,SAAgB,SAAS,KAAa;CACpC,OAAO,OAAO,KAAK,KAAK;AAC1B;;;;;;;;;;;ACAA,IAAa,eAAe,OAAsB,SAAwB;CACxE,QAAS,SAAS,MAAM,QAAQ,KAAM,OAAO;AAC/C;;;;;;;;;;;ACJA,SAAgB,SAAS,KAAa;CACpC,OAAO,OAAO,MAAM,KAAK;AAC3B"}