feat: Add complex argument function arg
All checks were successful
/ test (pull_request) Successful in 17s

Also removes circular imports from nanomath
This commit is contained in:
Glen Whitney 2025-04-24 13:09:15 -07:00
parent 474cc53d68
commit 8da23a84be
24 changed files with 91 additions and 90 deletions

View file

@ -1,7 +1,7 @@
import {Complex} from './Complex.js'
import {match} from "#core/helpers.js"
import {Returns} from "#core/Type.js"
import {Any} from "#core/TypePatterns.js"
import {Any, match} from "#core/TypePatterns.js"
import {NumberT} from '#number/NumberT.js'
export const complex = [
match(Any, (math, T) => {
@ -25,3 +25,6 @@ export const complex = [
return Returns(Complex(T), (r, m) => ({re: r, im: m}))
})
]
export const arg = match(
Complex(NumberT), Returns(NumberT, z => Math.atan2(z.im, z.re)))