#!/usr/bin/perl

use Math::MatrixReal;

@triangle = (Math::MatrixReal->new_from_string("[ -1 ]\n[ -1 ]\n"),
             Math::MatrixReal->new_from_string("[  0 ]\n[  1 ]\n"),
             Math::MatrixReal->new_from_string("[  1 ]\n[ -1 ]\n"));

$translation = Math::MatrixReal->new_from_string("[ 1 ]\n[ 3 ]\n");

# Add 2 x 1 translation matrix to all three 2 x 1 matrices in @triangle.

foreach (@triangle) { $_ += $translation }

print @triangle;
