Caculate trendline datapoints in TypeScript

If you want to calculate trendline datapoints in TypeScript, you can use the following code:       Code   module helpers.math { ‘use strict’; /** * Based off: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js * @param known_y – Array of numbers representing the y-axis values, [1, 2, …]. * @param known_x – Optional array …