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

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answerDennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 
Correcting the explanation
Source Link
Sherlock9
  • 12.4k
  • 1
  • 32
  • 68

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ½Σ  sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ½ sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ  sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 
More golfing
Source Link
Sherlock9
  • 12.4k
  • 1
  • 32
  • 68

Actually, 1010 8 bytes

This answer is based on Lynn's excellent Jelly answerDennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!Try it online!

;Σ½-2*ß♀;Σ♀/π♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ½ sum() and halve to get twice the semiperimeter, s2*s. - ♀/ Vectorized subtractdivide 2*s by [a, b, c] from s to get [s-[2*s/a, s-2*s/b, s-2*s/c]. 2*♂¬ Vectorized multiplysubtract [s-2 to get [2*s/a-2, s-2*s/b-2, s2*s/c-c] by 22]. ßπ PushGet the inputproduct [a,of b,the c]above againto get 8*(s/a-1)*(s/b-1)*(s/c-1). ♀/ Vectorized divide [a,This b,is c]the bysame [2*as 8(s-a), 2*(s-b), 2*(s-c)]/abc. π ì Get the product of the aboveInvert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 bytes

This answer is based on Lynn's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ½-2*ß♀/π 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ½ sum() and halve to get the semiperimeter s. -  Vectorized subtract [a, b, c] from s to get [s-a, s-b, s-c]. 2* Vectorized multiply [s-a, s-b, s-c] by 2. ß Push the input [a, b, c] again. ♀/ Vectorized divide [a, b, c] by [2*(s-a), 2*(s-b), 2*(s-c)]. π  Get the product of the above to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 

Actually, 10 8 bytes

This answer is based on Dennis's excellent Jelly answer. Golfing suggestions welcome! Try it online!

;Σ♀/♂¬πì 

Ungolfing

 Implicit input [a, b, c]. ; Duplicate [a, b, c]. Σ½ sum() to get twice the semiperimeter, 2*s. ♀/ Vectorized divide 2*s by [a, b, c] to get [2*s/a, 2*s/b, 2*s/c]. ♂¬ Vectorized subtract 2 to get [2*s/a-2, 2*s/b-2, 2*s/c-2]. π Get the product of the above to get 8*(s/a-1)*(s/b-1)*(s/c-1). This is the same as 8(s-a)(s-b)(s-c)/abc. ì Invert to get the aspect ratio, abc/8(s-a)(s-b)(s-c). Implicit return. 
Source Link
Sherlock9
  • 12.4k
  • 1
  • 32
  • 68
Loading