How to add two vectors in polar coordinates

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

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

edit retag flag offensive close merge delete

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

Thanks!

grante gravatar imagegrante ( 2021-08-20 16:03:53 +0100 )edit
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 ( 2021-08-20 23:11:44 +0100 )edit