// angle is in radians for faster calculations srecord PolarPt(double length, double angle) { DoublePt toDoublePt() { ret doublePt(length*cos(angle), length*sin(angle)); } meta-for Pt also as DoublePt { *(Pt p) { angle = atan2(p.x, p.y); length = p.length(); } } }