Law of cosines - triples: Difference between revisions
m
→{{header|R}}: Syntax highlighting.
(Added solution for Action!) |
ReeceGoding (talk | contribs) 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
inputs <- cbind(A = inputs[1, ], B = inputs[2, ])[sort.list(inputs[1, ]),]
Pythagoras <- inputs[, "A"]^2 + inputs[, "B"]^2
|