An open API service indexing awesome lists of open source software.

https://github.com/parth-paradkar/leastsquaremethod

This program plots(gives the points to be plotted) the best fitting linear graph from a set of readings.
https://github.com/parth-paradkar/leastsquaremethod

c graph-algorithms

Last synced: about 1 year ago
JSON representation

This program plots(gives the points to be plotted) the best fitting linear graph from a set of readings.

Awesome Lists containing this project

README

          

### LeastSquareMethod
***

Plot a linear graph from a set of given coordinates that crosses the least number of squares on the graph.

## How to install:

1) Open a new terminal window and create a folder in the desired location

```
mkdir leastsquare
````
2) Clone this repository in this directory

```
git clone https://github.com/parthmax99/LeastSquareMethod.git
```
3) You are good to go!

## Usage

1) If the data is stored in a CSV file, enter the file path(filename in case the file is present in the current directory as an argument)

![Terminal command for CSV file](/images/terminal_command_csv.png)

2) For a sample dataset the result will be as follows:

![Example 1](/images/result.png)

3) For a small number of points, you might prefer feeding the data through the terminal itself. The points must be in the format *[x,y]*

![Terminal input](/images/terminal_command1.png)

4) Output:

![Example 2](/images/result2.png)