Welcome to MaxCalc wiki!
Maxcalc is a small and portable calculator for Microsoft Windows. It as been designed to be a quick access calculator.
EQUATION FIELD: The left field of MaxCalc is the equation field. This is where you can type your equations. If you hit the HELP key, your equation will be added temporarly in the drop down list of the equation fields. You can recall or see previously stored equation by clicking on the down arrow boutton to the right of the equation field. You can also access it with the shortcut ALT+DOWN ARROW.
RESULT FIELD: The right field is the result field. The anwser is computer as you type. When the equation is imcomplete, MaxCalc will attent to complete it automatically. When an error is computed, the result value is Err. You can prevent the auto computation by pressing F6. The field will become yellow to significate that your equation need to be manually refreshed. You can either use F5 or F6 to restore it. This is handy when working with files.
POSITIONNING AND RESIZING: To move Maxcalc where you want it, left click on the calculator icon of the left. You can change the length of the application by drag and dropping it side edges. The Height can be adjusted by right clicking on the calculator icon. Finally, you can change the size of the result field by left clicking in the middle, between the result en equations fields.
MENU OPTIONS: The menu can be accessed by right clicking on the calculator icon.
PASTE: This will paste the content of the clipboard. (Instead of the using brut text like the paste option in the equation field, it will attend to convert the format to the MaxCalc arrays.
COPY AS COLUMN: This will copy the result in the "standard" spreadsheed format. The result will be as a column.
COPY AS ROW: This will copy the result in the "standard" spreadsheed format. The result will be as a row.
STR: Display the result in the "string format". Must be the first command on the equation. The 36 first symbol (0 to 35) are considered like 0,1,..,9,a,b,..,z. It is usefull when converting in Hexadecimal base.
ARRAY: An array is a list of number separated by comma. The are no multidimentionnals arrays. An array can also be formed from a range like in Matlab. The symbol : has to be used for this. Note that the increment can't be specified, it is set 1 or -1 automatically. (ex: 1:3 is equivalent to 1,2,3).
DECIMAL SEPARATION: The symbol for the decimal separation is the . (dot). The comma is reserved to separate element in an array. Don't worry if you use the , (comma) for the decimal separation when importing data to MaxCalc. MaxCalc will detect your system setting and convert it automatically when you chose one of the option under the calculator icon.
COMPLEX NUMBER: The complex numbers are accepted in MaxCalc. Some functions doesn't exist for the complex number (such as modulo). In such case the operation is applied as real on both real and imaginary part. It may be preferable to use the function NORM when your are not sure.
CONSTANT: The following constants are recognized by default: e=2.71..., pi=3.14..., h=3600, m=60, s=1. It is possible to add or remove some constants by typping the command: set VAR VALUE followed by the enter key. A constant can be removed by using the command unset VAR or remove VAR then the enter key. A constant can contain any maxcalc expression including array and complex number.
PARENTHESE: The symbol for the parentheses are ( and ). The parentheses can be inbricked. When the parentheses are incomplete, MaxCalc will closes them automatically to the extremeties. MaxCalc also accept the [ and ] for easier reading, but they are considered like normal ( and ). That mean that any [ or ] it could be matched with any ( or ).
TEXT: The text can be converted to array. To do this, the text to be converted must be between " and ". The text will be converted in the anscii standard.
ADDITION AND SUBSTRACTION: The symbols for the addition and the substraction are + and - respectively. When two arrays are added, the result is the sum term by term. If an array is bigger than the other, zero are used to complete the shortest array.
MULTIPLICATION AND DIVISION: The symbols for the multiplication and the division are * and / respectively. A division by 0 will return a 0 with an error.
MODULO: The symbol for the modulo is %.
POWER: The symbol for the power is ^. The symbol E (in uppercase) is also accepted for the scientific notation (power of 10).
COMPARAISONS: The symbols <, >, <= or =<, >= or =>, <> or !=, == are accepted to compare two numbers.
LOGICAL: The symbols NOT, && or AND and || or OR are used to compare boolean (Negation, AND and OR respectively). In MaxCalc, 0=False and all others numbers=True.
BITWIZE LOGICAL: The symbols >> or RSHIFT, << or LSHIFT, &, | and X| are used to compare two number bit per bit. (Right shift, left shift, and, or, xor respectively).
MINUS: The term minus can also be used to negate a number.
ROUND: The function round will approximate an expression. Is only one number is specified, the number will be rounded to the unity. If an array is specified, the first term of the array will be used for the number of decimal to keep on all others numbers of the array.
CEIL and FLOOR: Theses function return the lower and upper integer value.
ABS: The function abs is return the magnitude of a number (removing it sign).
SQRT, SQR AND SQT: Return the square power of a number. (Like x^0.5)
LOG and LN: The LN function return the natural logarithm of a number. The function log, will return the logarithm in base 10 of a number. When an array is specified, the first term is used for the base of the logarithm.
EXP: The function exp is equivalent to e^x.
TRIGONOMETRY AND HYPERTRIGONOMETRY: The following trigonometry function are accepted: SIN, COS, TAN, SEC, CSC, COT, ARCSIN, ARCCOS, ARCTAN, ARCSEC, ARCCSC, ARCCOT, SINH, COSH, TANH, SECH, CSCH, COTH, ARCSINH, ARCCOSH, ARCTANH, ARCSECH, ARCCSCH, ARCCOTH, The result are in radian.
STATISTIC: The following statistic function are accepted: MAX, MAXAT, MIN, MINAT, MAXS, MAXSAT, MINS, MINSAT, MEAN, VAR, STDDEV, CUMSUM, SUM and NORMALIZE.
HIST: Return the distribution of an array. The first argument must be the number of band. The remain argument are the data.
EXTRAPOLATION: The following extrapolation function recognized: HOLD, LINEAR and SPLINE. The first arugment must be the length of the x and y data. The second argument must the array containing the x data. The third argument must be the y data. The last argument is the x value of the data to extrapolate.
Ex: Spline(size(xdata),xdata,ydata,value)
RAND: The function Rand return an array of random number. The first argument must be the length. of the array, if no arguments is specified or if the specified length is 0, then only one element is returned. The default range is 0 to 1. If two arguments are supplied, the second one set the upper limit. Then if three arguments are specified, the second one set the lower limit and the third one the upper limit.
BASE CONVERTION: It is possible to convert from any base to any base inferior to 47. The decimal number are not supported. The function must receive an array of at least 3 elements. The first element is the initial base, the second element is the destination base and the others elements reprensent the number to convert term by term. Ex. "1","2" = 12. The letter can also be used. Ex. base(16,10,"a0") will convert the hexadecimal number A0 to decimal number. (Number, uppercase and lowercase letter are accepted between "" and are automatically converted.)
TOSTR: Return the string array corresponding to the specified decimal number.
FLIP and SWAP: Theses functions flip and swap will reverse an array.
SIZE and LENGTH: Theses functions return the length of the array.
MID: The function mid is used to return a part of an array. The first element specified must represent the starting point of the selection. The second represent the ending point of the selection. The counting start at 0. If two first elements (the starting and ending points) are between -1 and 0 they are used as normalized range.
Ex: mid(Start,Stop,Array)
MASK: This function is used to remove element from a list. It take two parameters. The first one must be the mask. Followed by the array to filter of the same size. The elements that will be filtered are the element that index match a zero in the mask.
Ex: mask("mask","array")
SORT: Sort an array. (Smaller to Larger)
ZEROS and ONES: Return an array containing only zeros or ones of the specified size.
DIFF: Return the different point per point like the numerical derivate.
CONVERT: Convert between different units:
Scale: db,%
Length: m,km,mi,nm,in,ft,yd
Speed: kn,m/s,mph,km/h,mi/h,knot,knts,mach
Mass and Weigth: g,n,a,kg,kn,lbs,ounce
Temperature: C,F,K
Pression: pa,kpa,at,tr,mmhg,bar,atm,inhg
Time: Usage: convert("time",array) will convert from second to the decimal format: wdhhmmss.d
Ex: convert("initial units","destination units",array)
EXP: e^x functions
NORM: Return the complex norm (magnitude)
ANGLE: Return the angle of a complex number.
REAL and IMAG: Return the real and the imaginary part of a number. It is also possible to used IMAGINARY for the imaginary part.
MATPROD: Return the matrix product of two array. The first argument must be the size of the first array. Followed by the two array.
FFT and IFFT: Return the fft and the ifft. If the number is not a multiple of 2, then the dft/idft is computed.
HFFT and HIFFT: Hfft is the same as fft, but return only the useful point (Half of the points). Hifft use only the half of the points (before SR/2) to do the ifft.
DFT and IDFT: Return the dft and the idft.
FFTCUT: Cut the mirror effect higher that fs/2 of the FFT.
CONV: Return the convolution of two array. The first argument must be the size of the first array. Followed by the two array.
CORR: Return the cross correlation of two array. The first argument must be the size of the first array. Followed by the two array.
SPECTRAL and ISPECTRAL: Return a matrix of fft. The first argument must be the fft size. The second argument must the normalized overlap (default =1). The remaining argument is the array of data. The function ISPECTRAL is the inverse function.
FREQ: Return a sinusoidale function. The first argument is the number of point. The second argument is the frequency. If the imaginary part of the frequency is equal to 1, then a saw function is returned. If the imaginary part is equal to 2, a triangle function is returned. If the imaginary part is equal to 3, a square function is returned. For any others value, a cosinus function is returned. The real part is used to compute the frequency. The third argument could be the amplitude.
FIR: Apply a fir filter to a signal. The first argument must be the number of coefficients (taps) of the fir. The second argument is the fir coefficients. The remaining arguments must be the signal to filter.
IIR: Apply a iir filter to a signal. The first argument must be the number of elements in the numerator. The second argument must be the number of element in the denumerator. The third arguments must be the numerator arguments. The fourth arguments must be the denumerator arguments. The last argument must be the signal to filter.
SMOOTH: Apply a smoothing filter to a signal. It is similar to fir(n,ones(n)*1/n,signal) but it assume that the value before and after edge are equal to the value at the edges. The first parameter must be the number of elements (n) for filtering followed by the signal.
ISPRIME: Return 1 if the numbers are prime.
NEXTPRIME: Return the next prime number.
IFACTOR: Return an array containing the prime factors of a number.
LCM: Return the Least commun multiple.
GCD: Return the Greatest commum divider.
!: Return the factorial number.
Ex: !"Expression"
# or PREV: Return the previous anwser. (The one stored by the ENTER Key.)
CLIPBOARD or PASTE: Return the current of the clipboard.
;$: Is use to insert intermediate expression in an expression.
Ex: 4;$1+2;$2 will return 6 because $1=4 and $2=$1+2.
The intermediate expression must be separated by ;, and the $ must be followed by the argument number.
LOOP and RAMP: Cycle through an array to a specified speed.
Ex: Loop(Speed, Array). Loop will cycle back and forth, while ramp will cycle only in one direction. The speed is specified in Sec. If different refresh are specified then the faster will be selected. If no speed is specified, a speed of 0.25s is assumed. If no array is specified, then a range from 0 to 1 is automatically assumed.
PLOT and YPLOT: Display a graph of the result. It is possible to zoom in the plot by drag and droping the mouse arround the desired area. The zoom out full option is available by right-clicking in the plot. The Real values are displayed in red, and the complex value in blue if they are different then zero.
XYPLOT: Display a graph of the result. Two array of the same size must be provided. The first one is the x value and the second one the y values.
XYFUNCTION and FUNCTIONL: Display a user editable graphic and return the x and y coordonates.
YFUNCTION: Display a user editable graphic and return the y coordonates.
IMAGE: Display an image. The first argument must be the width, the second one the height and the remain the data (from 0 to 2^24-1). It is possible to pan and zoom by using respectivly the left and right button of your mouse.
SOUND: Output a sound to the sound card. The first argument must be the sound card number. The second argument must be the sample rate. The remaining argument are the normalized data.
READ: Read a file and return the content of the file (like the copy and pase).
If the file contain .wav maxcalc will try to read the file using the wav standard. Maxcalc can read pcm wav file mono or stereo, with any sample rate, of type 1 with 8 or 16 bits or of type 3 with 32 bits. The first argument will be the number of bits per sample. The second argument is the number of channel (1=mono, 2=stereo). The third argument is the sample rate. The data of the wav starts at the fourth argument. When file is stereo, the complex part of the number is used to put the second channel.
If file contain .bmp maxcalc will try to read the file using the bitmap standard. The first argument returned will be the width and the second one will be the heigth.
If the file end with sound, Maxcalc will read the sound card output. In that case, the first argument must be the sound card number (starting at 0). The second argument must be the length of the capture in sample. The third argument must be the sample rate for the capture.
>>>: Redirect the result. By default the result will be written in text format in the maxcalc folder. Ex. Equation>>>"File"
If the file contain .wav the file will be written in wav format. In that case, if the first argument is >1 then it is assumed to be the sample rate. The output file is mono when an array of real is supplied. When an array of complex is supplied, the real and imaginary are used to produce the left and right channel. The wav file format is always in 32 bits normalized type 3 pcm.
If the file contain .bmp the file is will be written in 32 bits bitmap format. The first argument must be the width and the second one the heigth of the image.
If the file is sound, the result is outputted to the sound card. in that case, the first argument represent the sound card number (starting at 0). The second argument is the sampling rate. When no arguments are specified, the default settings are used: sound card 0 and a sampling rate of 8000Hz.
When a the file is written in text format, the result is appended to the end of the file if the file already exist.
COLOR: RED, GREEN and BLUE are supported to extract the 0-255 value of a color.
GRAY: Return the normalized luminance of a color.