Apr-05-2017, 11:28 AM
Hi everyone,
I'm a beginner in Python language and I've got a little problem with a matrix I tried to encode.
I want to have these vectors :
Here what I tried to do :
I also tried two for loops but it didn't work either.
Thank you for the time you'll pass on it, I know it would'nt be that hard
I'm a beginner in Python language and I've got a little problem with a matrix I tried to encode.
I want to have these vectors :
[[ 0 ] [ - l*cos(q_tri[:,1]) ] [ - l*cos(q_tri[:,1]) - l*cos(q_tri[:,2]) ] [ - l*cos(q_tri[:,1]) - l*cos(q_tri[:,2]) - l*cos(q_tri[:,3]) ] [ - l*cos(q_tri[:,1]) - l*cos(q_tri[:,2]) - l*cos(q_tri[:,3]) - l*cos(q_tri[:,4]) ]] for Yn[] and [[ 0 ] [ l*sin(q_tri[:,1]) ] [ l*sin(q_tri[:,1]) + l*sin(q_tri[:,2]) ] [ l*sin(q_tri[:,1]) + l*sin(q_tri[:,2]) + l*sin(q_tri[:,3]) ] [ l*sin(q_tri[:,1]) + l*sin(q_tri[:,2]) + l*sin(q_tri[:,3]) + l*sin(q_tri[:,4]) ]] for Xn[]But I couldn't be successful ...
Here what I tried to do :
Xn = [0] for a in range (0,n): Xn.append(L*np.sin(q_tri[:,a])) Yn = [0] for b in range (0,n): Yn.append(-L*np.cos(q_tri[:,b]))Here q_tri[] is of size n.
I also tried two for loops but it didn't work either.
Thank you for the time you'll pass on it, I know it would'nt be that hard
