From 04e15f7c85d41cd8ee98f56e8fd87e2501ea9a53 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 17 Jul 2023 23:36:12 -0700 Subject: [PATCH] use retstep instead of subtracting --- masque/shapes/arc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index 443b436..d2f216c 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -204,10 +204,10 @@ class Arc(Shape): # Approximate outer perimeter via numerical integration a0, a1 = a_ranges[1] # use outer arc - t = numpy.linspace(a0, a1, 10_000) # NOTE: could probably use an adaptive number of points + t, dt = numpy.linspace(a0, a1, 10_000, retstep=True) # NOTE: could probably use an adaptive number of points r0sin = r0 * numpy.sin(t) r1cos = r1 * numpy.cos(t) - perimeter = numpy.trapz(numpy.sqrt(r0sin * r0sin + r1cos * r1cos), dx=t[1] - t[0]) + perimeter = numpy.trapz(numpy.sqrt(r0sin * r0sin + r1cos * r1cos), dx=dt) #from scipy.special import ellipeinc #m = 1 - (r1 / r0) ** 2