Skip to main content
4 of 7
added 2 characters in body
Celeo
  • 530
  • 4
  • 12

Python 2, 48 47 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:(a*(d-f)+c*(f-b)+e*(b-d))/2.

The other, similarly simple approaches are longer:

def a(a,b,c,d,e,f):return(a*(d-f)+c*(f-b)+e*(b-d))/2. # 53
lambda t:(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 64
def a(t):return(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 70

Python's access to a determinate function is through numpy.

Thanks to muddyfish for 1 byte.

Celeo
  • 530
  • 4
  • 12