Although the scalars are r, theta and z the unit vectors are i, j andk. How would I get vectors like e_r and e_theta to work with those?
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxQeGu9q_i5YsCKCrevjSyOMQU49cdzHA2kG2PArXX0%3Dfg%40mail.gmail.com.
In [1]: from sympy.vector import CoordSys3D
...:
...: N = CoordSys3D('N', transformation='cylindrical')
In [2]: e_r = cos(N.theta)*N.i + sin(N.theta)*N.j
In [3]: e_theta = -sin(N.theta)*N.i + cos(N.theta)*N.j
In [4]: e_z = N.k
In [9]: v1 = 4*e_r + 3*e_z
In [10]: v1.magnitude()
Out[10]:
_________________________________________
╱ 2 2
╲╱ 16⋅sin (theta_N) + 16⋅cos (theta_N) + 9
In [11]: v1.magnitude().simplify()
Out[11]: 5
from sympy.vector import x, y, z, i, j, k, dot
a = 2*i + j
b = k + j
print(dot(a, b))