sympy.line.equation()
Same value and type, but what's the difference?"
How can I fix it?
What is the difference between z1 and z2?
from sympy import *
var('x y z1 z2')
z1=8*x+6*y+48
print("#z1",z1,type(z1))
z2=Line(Point(-6,0),Point(0,-8)).equation()
print("#z2",z2,type(z2))
if type(z1)==type(z2):
print("#","type==")
else:
print("#","type<>")
if z1==z2:
print("#","==")
else:
print("#","<>")
#z1 8*x + 6*y + 48 <class 'sympy.core.add.Add'>
#z2 8*x + 6*y + 48 <class 'sympy.core.add.Add'>
# type==
# <>
I try add .expand().simplify() 30 mins ago
from sympy import *
var('x y')
print("#z1#",solve(8*x+6*y+ 48 ,y))
print("# ", Line(Point(-6,0),Point(0,-8)).equation().expand().simplify() )
print("#z2#",solve(Line(Point(-6,0),Point(0,-8)).equation().expand().simplify(),y))
#z1# [-4*x/3 - 8]
# 8*x + 6*y + 48
#z2# []
Thank you.
from sympy import *
var('x y')
print("#z1#",solve(8*x+6*y+ 48 ,y))
print("# ", Line(Point(-6,0),Point(0,-8)).equation() )
print("#z2#",solve(sympify(str(Line(Point(-6,0),Point(0,-8)).equation())),y))
#z1# [-4*x/3 - 8]
# 8*x + 6*y + 48
#z2# [-4*x/3 - 8]