# Interpolation ## Introduction This project implements numerical interpolation methods in C. The program allows the user to enter known data points either manually or from a file and estimate unknown values using interpolation techniques. The program supports: - Linear interpolation - Polynomial interpolation using the Lagrange method The project also generates files that are ready for visualization using gnuplot. --- ## Features - Manual point input - File-based point input - Linear interpolation - Lagrange interpolation - Interpolation of a single query point - Generation of plot-ready output files - Automatic generation of a gnuplot script - Handling of invalid inputs and edge cases --- ## Compilation Compile the program using: gcc interpolation.c -o interp -lm Explanation: - gcc → C compiler - -o interp → creates executable named interp - -lm → links the math library --- ## Running the Program Run the executable: ./interp --- ## How to Use the Program ### Step 1 — Choose Input Method 1. Manual input 2. File input --- ### Step 2 — Enter Points Example: 0 0 1 1 2 4 --- ### Step 3 — Choose Program Mode 1. Interpolate a single value 2. Generate plot files --- ## Plotting with Gnuplot Install gnuplot: sudo apt update sudo apt install gnuplot -y Run the plot: gnuplot -persistent plot.gp --- ## Generated Files ### output.txt Contains interpolation data formatted for gnuplot. ### plot.gp Automatically generated gnuplot script. --- ## Libraries Used #include #include #include Purpose: - stdio.h → input/output and file handling - stdlib.h → dynamic memory management - math.h → mathematical operations --- ## Build Requirements The project requires: - GCC compiler - Linux terminal - gnuplot ---