the following is a (very)shorterned vesrion of my program
the normvecs vector is not getting overwritten , you woud be able to see for yourself just once you run this code snippet , the parameters are correct geom function takes an n+1 X 2 array and n as input, i guess i'm doing something really stupid (which i think i am) or i don't understand this behavior
import numpy as np
#geometry calculations
def geom(pts,n):
r = np.zeros(n)
normvecs = np.zeros((n,2))
tgtvecs = np.zeros((n,2))
alphap = np.zeros(n)
cpts = np.zeros((n,2))
#collocation points
cpts[:,0] = (pts[0:n,0]+pts[1:n+1,0])/2
cpts[:,1] = (pts[0:n,1]+pts[1:n+1,1])/2
#length of panels
r[:] = np.sqrt((pts[0:n,0]-pts[1:n+1,0])**2 + (pts[0:n,1]-pts[1:n+1,1])**2)
#angle of each panel with the horizantal(chord)/refernce axis
alphap[:] = np.arctan2(pts[1:n+1,1]-pts[0:n,1],pts[1:n+1,0]-pts[0:n,0])
#normal vectors
normvecs[:,0] = -np.sin(alphap[:])
normvecs[:,1] = np.cos(alphap[:])
xx = np.cos(alphap[:])
print(normvecs[:,0],normvecs[:,1],np.cos(alphap[:]),xx)
return
geom(np.random.rand(31,2),30)
normvecs[:,1] is showing just negative of nomvecs[:,0] i wasn't able to overwrite like normvecs[:,1] = xx (no errors .. but just printed the same thing)
I maynot sound clear,once if you run you may see what i'm trying to tell.
what's the problem?(if it is so!)