07-18-2021, 08:02 PM
Strange way to use numpy. The whole point of numpy is do add vectors in one operation, so you can compute an intermediate vector that holds your c and d values using;
The strange thing in your code is that when you do
Only the b[0] part is divided by np.pi, which looks odd, and the parentheses around the (b[0]) don't serve any purpose. So I assume you meant:
Since you have values up to 360, I assume you are trying to cover a full circle so, you may want to divide by 2*np.pi if you really want a value in radians, because a full circle is 2×π
Then I don't really understand what you do with e (linear sample between two values with an interval of 4?)? And what happens when i>=7?
Code:
# The vector of the sums:
a+b
# The vector of the sum, clamped at 360:
np.minimum(a+b,360)
# The vector of the sums, clamped and in radians
result=np.minimum(a+b,360)/np.pi
The strange thing in your code is that when you do
Code:
c = a[0]+(b[0])/np.pi
Only the b[0] part is divided by np.pi, which looks odd, and the parentheses around the (b[0]) don't serve any purpose. So I assume you meant:
Code:
c = (a[0]+b[0])/np.pi
Since you have values up to 360, I assume you are trying to cover a full circle so, you may want to divide by 2*np.pi if you really want a value in radians, because a full circle is 2×π
Then I don't really understand what you do with e (linear sample between two values with an interval of 4?)? And what happens when i>=7?