Least Square Method

Least Square Method (LSM) is a University Programme, created for the physics lab of the Technological Educational Institute of Kavala, and it demonstrates the optimum line according to the Least Square Method.


The user types the experimental values for X and Y, and the programme automatically calculates the following:

  • X^2
  • X*Y
  • Σ[Χ]
  • Σ[Υ]
  • Σ[Χ^2]
  • Σ[Χ*Υ]
  • Least Square Line’s a
  • Least Square Line’s b

After the calculations take place (instantly), the programme can draw the optimum line.

Then, the error is also calculable

The user has the ability to get other coordinates (X, Y) that are on that line, or to define a new line and get coordinates for that one.

This can be of use to professors who want to have many coordinates of a particular line, so that, in an exam, for example, each student is given a different X,Y, but all should result in the same a and b for the optimum y=a+bx line.

Download and Information

Download [Free of charge]:

Version x86

Version X64


This picture illustrates how numeric input takes place. Upon clicking or entering the X or Y textbox, the input form is fired up and you are asked to type a number. You may then proceed to type a number, or something representing a number, such as “log(10) + 9”, which will fill the box with the number “10”.

When you’ve finished with the input, you can see step by step how the “a” and “b” optimum line parameters are calculated, as well as their respective values. In addition, the error (σ) is also calculated. You can then take it one step further, with either the drawing of the optimum line, or the calculation of more X, Y values on the line.

In this picture we can see the points represented by the aforementioned values as circles, and the optimum line, given by the a and b values calculated via the Least Square method, passing through the points. We could also have set any axis to “log”.

Accessing the form from “Least Square Method” form’s “Actions Menu” will preload the a and b values. One retains the ability to modify the values, and is required to set the “X’s Limits” and “Iterations” in order for the Xs and Ys to be calculated.