Hello,
Heron's formula is to calculate the area of a triangle knowing the length of all its sides.
https://en.wikipedia.org/wiki/Heron%27s_...ormulation
With a, b and c the length of the sides and p the perimeter, I did this:
a = 2**(1/2)
b = 4
c = 26**(1/2)
p = a + b + c
s = (1/2)*p
area = (s*(s-a)*(s-b)*(s-c))**(1/2)
And it gave me that weird result when I tested with the word area:
(8.598863587914643e-18+0.14043009941971035j)
It should gave me a normal number.
Someone could help me please? Thank you!
Heron's formula is to calculate the area of a triangle knowing the length of all its sides.
https://en.wikipedia.org/wiki/Heron%27s_...ormulation
With a, b and c the length of the sides and p the perimeter, I did this:
a = 2**(1/2)
b = 4
c = 26**(1/2)
p = a + b + c
s = (1/2)*p
area = (s*(s-a)*(s-b)*(s-c))**(1/2)
And it gave me that weird result when I tested with the word area:
(8.598863587914643e-18+0.14043009941971035j)
It should gave me a normal number.
Someone could help me please? Thank you!