Racket, 64(削除) 64 (削除ここまで) 60 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)expt(max a b c)2)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.
- -4 bytes thanks to @xnor's suggestion to use
expt.
Racket, 64 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)(max a b c)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.
Racket, (削除) 64 (削除ここまで) 60 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(expt(max a b c)2)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.
- -4 bytes thanks to @xnor's suggestion to use
expt.
Racket, 64 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)(max a b c)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.
Racket, 64 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)(max a b c)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Racket, 64 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)(max a b c)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.
Racket, 64 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(max a b c)(max a b c)2)))
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.