Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add unpolar and cis.
  • Loading branch information
colomon committed Oct 26, 2011
1 parent e4121a3 commit 9b24a83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/CORE.setting
Expand Up @@ -208,6 +208,8 @@ my class Cool {
method cotanh() { Q:CgOp { (cotanh {self}) } }
method acotanh() { Q:CgOp { (acotanh {self}) } }
method atan2($x = 1) { Q:CgOp { (atan2 {self} {$x}) } }
method unpolar($angle) { unpolar(self, $angle); }
method cis() { cis(self); }
method rand() { self * rand; }
method split($matcher, $limit?, :$all?) {
Expand Down Expand Up @@ -2138,6 +2140,9 @@ multi sub log($x) { $x.log }
multi sub log($x, $base) { $x.log($base) }
sub log10($x) { $x.log(10) }
sub unpolar($mag, $angle) { Complex.new($mag * $angle.cos, $mag * $angle.sin); }
sub cis($angle) { Complex.new($angle.cos, $angle.sin); }
sub sin($x) { $x.sin }
sub asin($x) { $x.asin }
sub cos($x) { $x.cos }
Expand Down

0 comments on commit 9b24a83

Please sign in to comment.