#using Equation
a=input("Enter 'D' for delta or 'S' for star")
if(a=="S"):
r1= int(input("enter the value of r1:"))
r2= int(input("enter the value of r2:"))
r3= int(input("enter the value of r3:"))
ra=r2+r3+((r2*r3)/r1)
rb=r1+r3+((r1*r3)/r2)
rc=r2+r1+((r2*r1)/r3)
print("Ra:{:1.2f}\n Rb:{:1.2f}\n Rc/:{:1.2f}".format(ra,rb,rc))
elif (a=="D"):
ra= int(input("enter the value of ra:"))
rb= int(input("enter the value of rb:"))
rc= int(input("enter the value of rc:"))
r1=((rb*rc)/(ra+rb+rc))
r2=((ra*rc)/(ra+rb+rc))
r3=((rb*ra)/(ra+rb+rc))
print("DELTA TO STAR \n R1:{:1.2f}\n R2:{:1.2f}\n R3/:{:1.2f}".format(r1,r2,r3))
else:
print("Wrong input")
#using lcapy
from lcpay import circuit
ckt=circuit("""
I 1 0 20;down,color:black
R1 1_1 0_1 7;down size=1,color=brown
R2 1_2 0_2 9;down size=1,color=red
R3 1_3 0_311;down size=1,color=orange
R4 1_4 0_4 13;down size=1,color=gray
W 1 1_1;right
W 1_1 1_2;right
W 1_2 1_3;right
W 1_3 1_4;right
W 0 0_1;right
W 0_1 0_2;right
W 0_2 0_3;right
W 0_3 0_4;right
;draw""")
ckt.draw()
print(ckt.R1.V)
print(ckt.R2.V)
print(ckt.R3.V)
print(ckt.R4.V)