You could replace normalize
with pos ./ norm(pos)
to get rid of the error.
The problem seems to be that isempty(::Symbolics.Arr{Num,1})
or in your case isempty(pos)
(which is called inside normalize
) returns a Num
instead of a Bool
. Not sure if that is a feature or a bug, I suspect it is a feature for other aspects.