How to add two vectors in polar coordinates

asked 2021-08-19 00:23:45 +0200

grante gravatar image


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:

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

edit retag flag offensive close merge delete


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 ( 2021-08-19 22:52:47 +0200 )edit

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.


grante gravatar imagegrante ( 2021-08-20 16:03:53 +0200 )edit

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

Max Alekseyev gravatar imageMax Alekseyev ( 2021-08-20 23:11:44 +0200 )edit