sigma-py / orthopy

:triangular_ruler: Orthogonal polynomials in all shapes and sizes.
181 stars 18 forks source link

Understanding outputs of the functions #112

Closed IgnacioEG closed 2 years ago

IgnacioEG commented 2 years ago

I have a doubt about the inputs/outputs of the software. When I write:

x = np.linspace(-1,1,101)
evaluator = orthopy.c1.legendre.Eval(x, "classical")
for _ in range(5):
     print(next(evaluator)) 

what I get is the function legendre evaluated at x. However, when I write:

x = [0.1, -0.3]
evaluator = orthopy.s2.zernike.Eval(x, "normal")
for _ in range(5):
     print(next(evaluator))

What am I getting here?

nschloe commented 2 years ago

You're getting

[0.56418958]
[-0.33851375  0.11283792]
[-0.0829186  -0.78176402 -0.11055813]
[ 0.02872384  0.81384225 -0.27128075 -0.04149   ]
[0.01712759 0.27832336 0.58032048 0.37109782 0.00499555]

For each iteration, you're getting the values of the Zernike polynomials of the next degree.