Fix a TypeError generated by Math.asin(), which doesn't accept Decimal arguments.

This commit is contained in:
Louis Simard 2011-03-12 03:35:33 -05:00
parent ba3371e282
commit 9e49151ebf

View file

@ -2350,7 +2350,7 @@ def optimizeTransform(transform):
# #
# http://en.wikipedia.org/wiki/File:Sine_cosine_plot.svg # http://en.wikipedia.org/wiki/File:Sine_cosine_plot.svg
# shows asin has the correct angle the middle quadrants: # shows asin has the correct angle the middle quadrants:
A = Decimal(str(math.degrees(math.asin(sin_A)))) A = Decimal(str(math.degrees(math.asin(float(sin_A)))))
if cos_A < 0: # otherwise needs adjusting from the edges if cos_A < 0: # otherwise needs adjusting from the edges
if sin_A < 0: if sin_A < 0:
A = -180 - A A = -180 - A