Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfishmuddyfish for 1 byte and xnorxnor for catching an error.

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

Needed to pass to `abs`
Source Link
Celeo
  • 530
  • 4
  • 12

Python 2, 48 4747 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 5357
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 6467
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 7074

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

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.

Python 2, 48 47 50 bytes

Very simple; follows the standard equation:

lambda a,b,c,d,e,f:abs(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 abs(a*(d-f)+c*(f-b)+e*(b-d))/2. # 57
lambda t:abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 67
def a(t):return abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2. # 74

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

Thanks to muddyfish for 1 byte and xnor for catching an error.

added 2 characters in body
Source Link
Celeo
  • 530
  • 4
  • 12
Loading
added 38 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135
Loading
added 106 characters in body
Source Link
Celeo
  • 530
  • 4
  • 12
Loading
Source Link
Celeo
  • 530
  • 4
  • 12
Loading