Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

MY PROGRAMMES

Saturday, April 1, 2023

CENTROID OF A TRIANGLE USING MIDPOPINT FORMULA

print("Enter the coordinates")
X1=int(input(" X1 = "))
Y1=int(input(" Y1 = "))
X2=int(input(" X2 = "))
Y2=int(input(" Y2 = "))
X3=int(input(" X3 = "))
Y3=int(input(" Y3 = "))
M1=(X1+X2+X3)/3
M2=(Y1+Y2+Y3)/3
print("\n","The coordinates of A = (",X1,",",Y1,")","\n","The coordinates of B = (",X2,",",Y2,")","\n","The coordinates of C = (",X3,",",Y3,")","\n")
print("As, centroid = ","X1+X2+X3",",","Y1+Y2+Y3")
print("                --------   --------")
print("                   3          3       ")
print("Therefore, centroid of triangle ABC = (",M1,",",M2,")")

OUTPUT