pipirima/trend-line-calculator

There is no license information available for the latest version (0.3.2) of this package.

Calculation of trend line parameters for a given set of chart points

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

pkg:composer/pipirima/trend-line-calculator

0.3.2 2023-01-24 16:16 UTC

This package is auto-updated.

Last update: 2025-09-24 21:55:00 UTC


README

Calculation of trend line parameters for a given set of chart points.

Usage

use Pipirima\TrendLine\Calculator;

// ...

        // create points
        $points = [
            [1, 2],
            [2, 3],
            [3, 6],
            [4, 8],
            [5, 10],
            [6, 12],
        ];

        // calculate trend line
        $calculator = new Calculator();
        $line = $calculator->calculateLine($points);

        // check its coefficients
        $this->assertLessThan(0.0001, abs(2.0857 - $line[0]));
        $this->assertLessThan(0.0001, abs(-0.46667 - $line[1]));