tccubrt.c - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
tccubrt.c (226B)
---
1 #include <u.h>
2 #include <libc.h>
3 #include "map.h"
4
5 void
6 ccubrt(double zr, double zi, double *wr, double *wi)
7 {
8 double r, theta;
9 theta = atan2(zi,zr);
10 r = cubrt(hypot(zr,zi));
11 *wr = r*cos(theta/3);
12 *wi = r*sin(theta/3);
13 }