Changed the input of circle_fct
from float
to numpy.ndarray
. This allows to parameterize a whole array at once rather then a single point. This is useful, because otherwise you would need to generate a list or use numpy.fromfunction
to get a whole circle.
Essentially that means you can do:
>>> t = np.linspace(0, 2*np.pi, 10, endpoint=False)
>>> circle_fct(t, (0,0,0), radius=1, normals=(0,0,1))
array([[ 1.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 8.09016994e-01, 5.87785252e-01, 0.00000000e+00],
[ 3.09016994e-01, 9.51056516e-01, 0.00000000e+00],
[-3.09016994e-01, 9.51056516e-01, 0.00000000e+00],
[-8.09016994e-01, 5.87785252e-01, 0.00000000e+00],
[-1.00000000e+00, 1.22464680e-16, 0.00000000e+00],
[-8.09016994e-01, -5.87785252e-01, 0.00000000e+00],
[-3.09016994e-01, -9.51056516e-01, 0.00000000e+00],
[ 3.09016994e-01, -9.51056516e-01, 0.00000000e+00],
[ 8.09016994e-01, -5.87785252e-01, 0.00000000e+00]])
This is a breaking change, no tests or similar have been changed to account for it yet, I just want to get some feedback for now. I personally don't see a single reason why not to do it this way. The motivation to make this change was because in math.geometric_objects.py
the function circle_fct
is used very ineffectively.
There are more function in math.euclidean.py
that could be vectorized like this.