From 338e56f1b145ed3088096b6f3e8d7dd99a254273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sundstr=C3=B6m?= Date: Mon, 21 Feb 2011 03:01:05 -0800 Subject: [PATCH] A trig. improvement TODO I left by the wayside; Decimal seems very unhelpful here. :/ --- scour.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scour.py b/scour.py index 2890bc7..ecbc912 100755 --- a/scour.py +++ b/scour.py @@ -2339,6 +2339,8 @@ def optimizeTransform(transform): elif (A1 == B2 and -1 <= A1 <= 1 and A3 == 0 and -B1 == A2 and -1 <= B1 <= 1 and B3 == 0 # as cos² A + sin² A == 1 and as decimal trig is approximate: + # FIXME: the "epsilon" term here should really be some function + # of the precision of the (sin|cos)_A terms, not 1e-15: and abs((B1 ** 2) + (A1 ** 2) - 1) < Decimal("1e-15")): [sin_A, cos_A] = [B1, A1] # while asin(A) and acos(A) both only have an 180° range