How to add two vectors in polar coordinates

asked 3 years ago

grante gravatar image

Hello,

I wish to be able to add two polar vectors and get the result as a function of r1, r2, phi1, and phi2

The result is shown in: math.stackexchange.com/questions/1365622/adding-two-polar-vectors

Is this possible using SageMath ?

I tried to do this using the 3D Euclidean space for cylindrical coordinates in SageMath but could not get the result.

Thanks, Grant

Preview: (hide)

Comments

What exactly are you looking for? The math.stackexchange page that you cited gives formulas, and those are easy to write in Sagemath. I wouldn't expect this to be built in, but just do r = sqrt(r1^2 + r2^2 + 2*r1*r2*cos(phi2-phi1)) and similarly phi = phi1 + atan2(...).

John Palmieri gravatar imageJohn Palmieri ( 3 years ago )

I wish to actually calculate the r & phi symbolically as it is shown in the math.stackexchange page given the r1, phi1 and r2, phi2 in polar coordinates.

I do not know if SageMath can do this --- perhaps, it is possible using the vector calculus in the Euclidean Space.

Thanks!

grante gravatar imagegrante ( 3 years ago )
1

Wouldn't it be easier to convert coordinates to Cartesian, perform the addition, and then convert the result back to polar? Sage provides a bunch of conversion functions - see https://doc.sagemath.org/html/en/them...

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )