Chapter 2.4.3 Qalculate!
========================

Qalculate! is the default calculator shipped in Lubuntu since 25.04.

Usage
-----
To do simple airithmetic computations type the numbers into the field just below the toolbar. To start a calculation press :kbd:`enter` or press the :guilabel:`=` button. To add multiple numbers press :kbd:`+` or click the :guilabel:`+` button. To subtract two numbers press :kbd:`-` or click :guilabel:`-`. To multiply two numbers press :kbd:`*` or click :guilabel:`x`. To divide two numbers press :kbd:`/` or click the :guilabel:`/` button. To input decimals into Qalculate! type :kbd:`.` as the decimal point or click :guilabel:`.` To input the last answer you calculated click the :guilabel:`ANS` button. To delete the last character you typed press :kbd:`backspace` or click the :guilabel:`trash can` button. To clear all you have inputted left click the :guilabel:`Leftward pointing arrow with an x` button or press :kbd:`Escape`. To start doing an operation first use a parenthesis to do an operation first :kbd:`(` or click :guilabel:`(`. To close the operation you want to do first in order of operations use a close parenthesis so press :kbd:`)` or left click on :guilabel:`)`. To have both an open and close parentheses click the :guilabel:`(x)` button. If you have an error in your syntax an orange triangle will show up. To get more information on what your error is mouseover the orange triangle. To get more information on a button you can also mouseover that button.

.. image:: qalculate-mainwindow.png

Below where you type in calculations is a history of your previous calculations. To go back in your history press the :kbd:`Down arrow` key. To go one step forward in your history press the :kbd:`Up arrow` key. To move the cursor one character to the left press the :kbd:`left arrow` key or left click the :guilabel:`left arrow`. To move the cursor one arrow to the right press the :kbd:`right arrow` key or left click the :guilabel:`right arrow` key. To move the cursor to the end press the :kbd:`End` key or right click the :guilabel:`right arrow` button. To move the cursor to the start press the :kbd:`Home` key or right click the :guilabel:`left arrow` button.

To copy text from Qalculate! select the text and press :kbd:`Control + C` or right click and select :menuselection:`Copy`. To cut the text from Qalcualate! press :kbd:`Control +X` or right click and select :menuselection:`Cut`. To past text press :kbd:`Control +V` or right click and select :menuselection:`Paste`.

To store a value in calculator memory left click the :guilabel:`MS` button. To later get the same value out of the calculator left click the :guilabel:`MR` button. To clear the memory stored in the calculator press the :guilabel:`MC` button.

To save a new variable in Qalculate! press :kbd:`Control +S` or left click the :guilabel:`floppy disk` icon and a window will popup. Type a name for your variable in the :guilabel:`Name` field. The :guilabel:`Required` tab is for required fields for your variable. Type what you want your variable to be equal too in the :guilabel:`Value` field. To add additional description to your variable use the :guilabel:`Description` tab. Choose which category to put this variable in in :guilabel:`Category`. To give a descriptive name to your variable type that in :guilabel:`Descriptive name`. To toggle hiding a variable check/uncheck the :guilabel:`Hide variable` checkbox. To add more description to your variable type that in the :guilabel:`Description` field.

To bring up an extensive list of functions left click the :guilabel:`fx` button or press :kbd:`Control + F`. On the left hand side of the window is a :guilabel:`Category` column and to choose functions from that category left click on the category name. To see a list of the actual function are under the :guilabel:`Function` column. To insert a function into the main window left click the :guilabel:`Insert` button. To calculate an answer in a popup left click the :guilabel:`Calculate` button. To search for a function type in the magnifying glass field. To save a function in your favorites check the :guilabel:`Favorite` checkbox.

.. image:: qalculate-functions.png

To have a large list of many different units you can open by pressing :kbd:`control +U` or left click on the :guilabel:`ruler` button. Under the left column labeled :guilabel:`Category` and left click on a category to select that category of unit. To search for a unit type in the :guilabel:`Magnifying galss` button. To select a unit left click on it on the right column. To insert the unit left click on the :guilabel:`Insert` button. To add a unit to your favorites check the :guilabel:`Favorite` checkbox. To convert between units enter the number in the bottom of the window and then type how many units to convert from in the second from the bottom field and then select the bottom right field what to convery to will show the  converted result.

.. image:: qalculate-units.png

Qalculate also does many operations with fractions. To input 1/2 into something you can middle click on the :guilabel:`2` button. Similarly to input 1/3 middle click on :guilabel:`3` and for 1/4 middle click on :guilabel:`4` and so on. Qalculate will also simplify fractions if you type them in so if you type in 4/16 Qalculate! will reduce it to 1/4 and then also provide a decimal answer with a :guilabel:`=` sign for an exact value or an :guilabel:`≈` for an approximate solution if not exact. Qalculate! will also let you add, subtract, multiply, divide, or more advanced fractions with fractions and still show the result as fractions.

To plot functions in Qalculate! press :kbd:`Control + P` or left click on the :guilabel:`graph` button.  The :guilabel:`Data` tab will have info on what you want values to plot. To give your name to a function to plot enter that in the :guilabel:`Title` field. Type what you want to plot in the :guilabel:`Expression` field. To change what each varible is called change the :guilabel:`X variable` field. To change what style to draw the plot change the :guilabel:`Style` drop down. To change how to smooth your plot use the :guilabel:`Smoothing` drop down. To add another function to be plotted left click the :guilabel:`Add` button. To have the plot redrawn with your changes left click the :guilabel:`Apply` button. To remove something you want to plot left click the :guilabel:`Remove` button. On the bottom of this window is a list of everything you have to plot. The title of what you are plotting is listed in the :guilabel:`Title` column. The formula for what you are plotting is in the :guilabel:`Expression` column.

.. image:: qalculate-plot-data.png

To channge what values to take in the functions use the :guilabel:`Function Range` tab. To change what the lowest value for x to plot enter :guilabel:`Minimum x value` field. To change the highest value to plot use the :guilabel:`Maximum x value`. To change how many points to plot change the :guilabel:`Sampling rate` field. To only show the real part of functions uncheck the :guilabel:`Show real and imaginary parts` checkbox. To apply changes you make to your plot left click the :guilabel:`Apply` button.

.. image:: qalculate-plot-function-range.png

The :guilabel:`Appearance` tab changes how the plot you make will appear. To have a title for your plot type in the :guilabel:`Title` field. To choose to display a grid for your plot check the :guilabel:`Display grid` checkbox. To have a full border around your plot check the :guilabel:`Display full border` checkbox. To choose a lowest value to show on the y axis check the :guilabel:`Minimum y value` checkbox and select the minimum value you want to show. To have a logarithmic scale on the x axis check the :guilabel:`Logarithimic x scale` checkbox and then to the right input the logarithimc base. To have logarithimic scale on the y axis check the :guilabel:`Logarithimic y scale` checkbox and input the logarithimc base to the right. To put an label on your x axis type it in the :guilabel:`x-axis label` field. To have a label on your y axis type in in the :guilabel:`y-axis label` field. To change the width of your line change the :guilabel:`Line width` field. To change where to place the legend use the :guilabel:`Legend placement` drop down. To have your changes applied left click the :guilabel:`Apply` button. 

.. image:: qalculate-plot-result.png

To exponentiate a base number to a power left click x :sup:`y` or type :kbd:`^`. To square a number right click x :sup:`y` or type :kbd:`sq()` around what you want to square. To raise e to a power middle click x :sup:`y` or type :kbd:`exp()` around what power you want to raise e to. To take the square root of something left click the :guilabel:`√` button or insert a :kbd:`√` character. To take the cube root of something right click the :guilabel:`√` button or type :kbd:`cbrt()`. To take the nth root of something middle click on the :guilabel:`√` button or type :kbd:`root( , )` where the first thing is what you are taking the root of and the second is which root to take.

To take a natural lograrithm left click on the :guilabel:`ln` button or type in :kbd:`ln()`. To take a  logarithim on base 10 right click on the :guilabel:`ln()` button or type in :kbd:`log10()`. To take a logarithim with base n middle click on :guilabel:`ln` and then input your base.

Trigonometery
-------------
Qalculate! offers many different trigonometric functions. When using these functions having the correct angle unit is important to have the angle unit set correctly or else you will get the wrong answer. To set the angle unit to degrees left click the left most button with two sliders and select :menuselection:`Degrees` in which 360 degrees make one full circle. To set the angle unit to radians in which 2π radians make one full circle left click the left most button on the toolbar and select :menuselection:`Radians`. To have the angle unit set to Gradians in which 400 gradians make a full cirlce left the leftmost button on the toolbar and select :menuselection:`Gradians`.

To take the sine function of something left click the :guilabel:`sin` button or type :kbd:`sin()`. To take the inverse sine function of something right click the :guilabel:`sin` button or type :kbd:`arcsin()`. To take the cosine of something left click the :guilabel:`cos` button or type :kbd:`cos()`. To take the tangent function of something left click on the :guilabel:`tan` button or type :kbd:`tan()`. To take the inverse tangent right click on the :guilabel:`tan` button or type :kbd:`arctan()`.


Version
-------
Lubuntu ships with version 5.5.0 of Qalculate!

How to Launch
-------------
To launch Qalculate! :menuselection:`Accessories --> Qalculate! (Qt)` or run 

.. code :: 

  qualculate-qt
 
from the command line.
