Skip to content

Commit

Permalink
cartesian and polar nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomara-x committed Apr 28, 2024
1 parent d2454d7 commit 7845e7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ math
- `atanh()`
- `atan2()`
- `hypot()`
- `pol()`
- `car()`
- `squared()`
- `cubed()`
- `dissonance()`
Expand Down
2 changes: 2 additions & 0 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ pub fn str_to_net(op: &str) -> Net32 {
})));
}
}
"pol" => { return Net32::wrap(Box::new(map(|i: &Frame<f32, U2>| (i[0].hypot(i[1]), i[1].atan2(i[0])) ))); }
"car" => { return Net32::wrap(Box::new(map(|i: &Frame<f32, U2>| (i[0]*i[1].cos(), i[0]*i[1].sin()) ))); }
_ => {}
}
Net32::wrap(Box::new(dc(0.)))
Expand Down

0 comments on commit 7845e7e

Please sign in to comment.