LoginSignup
0
0

More than 1 year has passed since last update.

極座標と直交座標「22年 公立千歳科技大 理工 1(2)」をsympy でやってみた。

Last updated at Posted at 2022-06-30

オリジナル

r**2=(r*(sin(t) + 4*cos(t))-5 + r**2*sin(t)**2

sympyで

作図は、sympyのplotモジュールです。matplotlibではありません。

Figure_1.png

from sympy import *
var('x y r t')
myEq=Eq(r**2,(r*(sin(t) + 4*cos(t))-5 + r**2*sin(t)**2).expand(trig= true))
myEq=myEq.subs({r**2:x**2 + y**2,r*cos(t):x,r*sin(t):y})
y=solve(myEq,y)[0]
print("#",y)
plot(y)
# x**2 - 4*x + 5

wolframalphaで

勉強中

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0