Skip to content

Commit

Permalink
added func2Mat
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenovic committed Feb 3, 2021
1 parent 5d81208 commit fc44e78
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions clifford/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
orthoMat2Versor
mat2Frame
frame2Mat
func2Mat
omoh
rotor_decomp
Expand Down Expand Up @@ -222,6 +223,24 @@ def frame2Mat(B, A=None, I=None, is_complex=None):
M = array(M).reshape(len(B), len(B))
return M, I

def func2Mat(f,I):
'''
Convert a function to a matrix by acting on standard basis
Parameters
---------------
f : function
function that maps vectors to vectors
I : MultiVector
psuedoscalar of basis
See Also
---------
frame2Mat
'''
A = I.basis()
B = [f(a) for a in A]
return frame2Mat(B=B, A=A,I=I)

def orthoFrames2Versor_dist(A, B, eps=None):
'''
Expand Down

0 comments on commit fc44e78

Please sign in to comment.