Triangle sample function (under dev)