Law of cosines - triples: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
(Added solution for Action!)
m (→‎{{header|R}}: Syntax highlighting.)
Line 2,161:
=={{header|R}}==
This looks a bit messy, but it really pays off when you see how nicely the output prints.
<lang Rrsplus>inputs <- cbind(combn(1:13, 2), rbind(seq_len(13), seq_len(13)))
inputs <- cbind(A = inputs[1, ], B = inputs[2, ])[sort.list(inputs[1, ]),]
Pythagoras <- inputs[, "A"]^2 + inputs[, "B"]^2
331

edits