Ok, I am trying to create a cross product function in the TI-NSpire that took n-1 vectors of dimension n and take the determinant of a matrix like this:
[[u_x,u_y,u_z,u_w],
[a_1,a_2,a_3,a_4],
[b_1,b_2,b_3,b_4],
[c_1,c_2,c_3,c_4]]
The top row is the unit vectors pointed in the direction of the axes. Unfortunately, the issue is that unless I give the calculator undefined variables, finding the determinant of this matrix results in an error, since either u_x, u_y... etc are vectors, and the matrix is not a proper matrix, or the vectors are values, and the determinant results in a single value, rather than a vector. What I can do, however is leave the unit vectors undefined and perform the determinant, then define the variables after the determinant is done.
What I am left with is either limiting myself to a maximum vector size (not unreasonable, but I'd prefer to not use this) or dynamically create a list of n undefined local variables that I can set to unit vectors after the computation is complete.
My question is, how would one perform the second option, if at all possible?
edit for the code: (Note: this is currently using the list of variables that I mentioned. Unfortunately, the issue with this is "5→{a,b,c,d}[1,2]" errors.)
Define LibPub cross_p(mat)=
Func
:Local i_,n_,unit_v,unit_list
:Local dim_v,num_v,len_v,new_v
:Local det_v
:[a,b,c,d,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]→unit_list
:dim(mat)→dim_v
:dim_v[1]→num_v
:dim_v[2]→len_v
:newMat(len_v,len_v)→unit_v
:For n_,1,len_v
: 1→unit_v[n_,n_]
:EndFor
:If num_v=len_v-1 Then
: newMat(len_v,len_v)→new_v
: subMat(unit_list,1,1,1,len_v)→new_v[1]
: For i_,1,num_v
: mat[i_]→new_v[i_+1]
: EndFor
: det(new_v)→det_v
: For i_,1,len_v
: unit_v[i_]→unit_list[1,i_]
: EndFor
: Return det_v
:EndIf
:EndFunc