(v1, v2)
return Symbol(dot_str)
Dot product of two basis vectors returns a Symbol
Dot product of two basis vectors returns a Symbol
Dot product of two basis vectors returns a Symbol
def basic_dot(v1, v2):
        """
        Dot product of two basis vectors returns a Symbol
        """
        i1 = list(Vector.basis).index(v1)  # Python 2.5
        i2 = list(Vector.basis).index(v2)  # Python 2.5
        if i1 < i2:
            dot_str = '(' + str(Vector.basis[i1]) + '.' + str(Vector.basis[i2]) + ')'
        else:
            dot_str = '(' + str(Vector.basis[i2]) + '.' + str(Vector.basis[i1]) + ')'
        return Symbol(dot_str)
def basic_dot ( v1 , v2 ) : i1 = list ( Vector . basis ) . index ( v1 ) # Python 2.5 i2 = list ( Vector . basis ) . index ( v2 ) # Python 2.5 if i1 < i2 : dot_str = '(' + str ( Vector . basis [ i1 ] ) + '.' + str ( Vector . basis [ i2 ] ) + ')' else : dot_str = '(' + str ( Vector . basis [ i2 ] ) + '.' + str ( Vector . basis [ i1 ] ) + ')' return Symbol ( dot_str )