This project is a simple interactive sketch that demonstrates linear regression using the p5.js library. Users can add points by clicking on the canvas, and the sketch will dynamically calculate and display the best-fit line using linear regression. Click here for demo
- Interactive Canvas: Click to add points.
- Dynamic Linear Regression: Automatically calculates and displays the best-fit line.
- Reset Button: Easily reset the canvas and start over.
- p5.js: A JavaScript library for creative coding.
index.html
: The main HTML file that includes the p5.js and p5.sound.js libraries.style.css
: Basic styling for the canvas.sketch.js
: The main JavaScript file containing the sketch logic.
- Clone the repository.
- Open index.html in your web browser.