ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 19 Aug 2021 00:23:45 +0200How to add two vectors in polar coordinateshttps://ask.sagemath.org/question/58542/how-to-add-two-vectors-in-polar-coordinates/ 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, GrantgranteThu, 19 Aug 2021 00:23:45 +0200https://ask.sagemath.org/question/58542/Polar to Cartesian most Elegant way ?https://ask.sagemath.org/question/41632/polar-to-cartesian-most-elegant-way/ Hi
## polar to Cartesian
forget()
# trying to get (b * x + sqrt(x^2 + y^2)) -1= 0 from r==1/(1+b*cos(t))
# first by hand:
# sqrt(x^2 + y^2) = 1 / (b * x / sqrt(x^2 + y^2) + 1)
# sqrt(x^2 + y^2) = sqrt(x^2 + y^2) / (b * x / sqrt(x^2 + y^2) + sqrt(x^2 + y^2))
# sqrt(x^2 + y^2) = sqrt(x^2 + y^2) / (b * x + sqrt(x^2 + y^2))
# 1 = 1 / (b * x + sqrt(x^2 + y^2))
# (b * x + sqrt(x^2 + y^2)) -1= 0
# second with SageMath:
## Sagemath polar to Cartesian
forget()
t,x,y,b,r = var('t x y b r')
assume(t,'real')
#b=0.5
eq0=r==1/(1+b*cos(t))
eq1=x==r*cos(t)
eq2=y==r*sin(t)
eq3=r==sqrt(x^2 + y^2)
S=solve(eq1,cos(t))
show(S)
eq4=eq0.substitute(S[0])
eq5=eq4.substitute(eq3)
show(eq5)
eq6=(eq5.simplify_full())
eq6=(eq6/eq6.rhs().numerator())
show(eq6)
eq7=1/eq6
eqFinal=eq7-1
show(eqFinal)
is there an much elegant way to get the cartesian (b * x + sqrt(x^2 + y^2)) -1= 0 from polar r==1/(1+b*cos(t))
with sagemath (I find my Sagemath way laborious !) ?
ortolljMon, 19 Mar 2018 17:10:17 +0100https://ask.sagemath.org/question/41632/Polar plot like matplotlib out of the box in Sage?https://ask.sagemath.org/question/26238/polar-plot-like-matplotlib-out-of-the-box-in-sage/Is there a way to plot something like this: http://matplotlib.org/examples/pylab_examples/polar_demo.html i.e. with these fancy polar axes out of the box in Sage. Or should I invoke matplotlib directly?PetrWed, 18 Mar 2015 13:51:45 +0100https://ask.sagemath.org/question/26238/Polar plot by points? (i.e. polar_line?)https://ask.sagemath.org/question/26044/polar-plot-by-points-ie-polar_line/ Hello!
If one operates in cartesian coordinates and has a function, he can plot it using *plot*. If it is a data points one can consider using *line* function. Accordingly, if we operate in polar coordinates, for the function plotting we have *polar_plot*, but what if we have only data points and we need them to be plotted in polar axes? Like, if we have an array of $[\phi_i, r_i]$.
I didn't find anything appropriate (tried polar_line and line(polar=True)) so I wrote:
def polar_line(polar_points, **kwds):
return line([(r * cos(phi), r * sin(phi)) for r, phi in polar_points], **kwds)
I am wondering is there anything default in sage for plotting in polar axes by data points?EugeneFri, 06 Mar 2015 13:45:48 +0100https://ask.sagemath.org/question/26044/