From 4f356d7e8f95b03227159d96cda8b70cbf759053 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 22 Jan 2018 21:57:38 -0800 Subject: [PATCH] Added simple R3_to_complex function --- helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers.py b/helpers.py index 737eb2b7..079b0b5e 100644 --- a/helpers.py +++ b/helpers.py @@ -224,6 +224,9 @@ def adjacent_pairs(objects): def complex_to_R3(complex_num): return np.array((complex_num.real, complex_num.imag, 0)) +def R3_to_complex(point): + return complex(*point[:2]) + def tuplify(obj): if isinstance(obj, str): return (obj,)