diff --git a/anki-sin-cos-table.py b/anki-sin-cos-table.py index bbfc874..fddfb15 100644 --- a/anki-sin-cos-table.py +++ b/anki-sin-cos-table.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from collections import OrderedDict from functools import reduce from sympy import latex, simplify @@ -14,8 +15,12 @@ def as_csv(*values): return reduce(lambda a, b: a + ";" + b, values) -xs = map(simplify, - [i * pi / 4 for i in range(-16, 16)]) +def deduplicate(iterable): + return list(OrderedDict.fromkeys(iterable)) + + +xs = sorted(deduplicate(map(simplify, + [i * pi / 4 for i in range(-16, 16)] + [i * pi / 6 for i in range(-24, 24)]))) for x in xs: for f in [sin, cos, tan]: