Global Function Manual


ABS

| HOME | BACK |

Purpose

To calculate an absolute value of a number.

abs(x) =  x    if x > 0

abs(x) = -x    if x < 0

Usage

{double} ret  =  ABS({double} argm1)

argm1 = a number

Example:

->a = abs(-5.7)

->print a

        5.70000

See also

round, fix

| HOME | BACK |


ACOS

| HOME | BACK |

Purpose

To calculate an inverse cosine function of a number.  The return is an angle, in a unit set by command "set angle", ranging from -90 degrees to +90 degrees.

Usage

{double} ret  =  ACOS({double} argm1)

argm1 = a number between -1 to +1

Example:

->set angle

Angle mode = DEG

->a = acos(0)

->print a

        90.00000

See also

asin, atan, atan2

| HOME | BACK |


ACOSH

| HOME | BACK |

Purpose

To calculate an inverse hyperbolic cosine function of a number.

Usage

{double} ret  =  ACOSH({double} argm1)

argm1 = a number

Example:

->a = acosh(2)

->print a

        1.31696

See also

asinh, atanh

| HOME | BACK |


ASIN

| HOME | BACK |

Purpose

To calculate an inverse sine function of a number.  The return is an angle, in a unit set by command "set angle", ranging from -90 degrees to +90 degrees.

Usage

{double} ret  =  ASIN({double} argm1)

argm1 = a number between -1 to +1

Example:

->set angle

Angle mode = DEG

->a = asin(1)

->print a

        90.00000

See also

asin, atan, atan2

| HOME | BACK |


ASINH

| HOME | BACK |

Purpose

To calculate an inverse hyperbolic sine function of a number.

Usage

{double} ret  =  ASINH({double} argm1)

argm1 = a number

Example:

->a = asinh(2)

->print a

        1.44364

See also

acosh, atanh

| HOME | BACK |


ATAN

| HOME | BACK |

Purpose

To calculate an inverse tangent function of a number.  The return is an angle, in a unit set by command "set angle", ranging from -90 degrees to +90 degrees.

Usage

{double} ret  =  ATAN({double} argm1)

argm1 = a number

Example:

->set angle

Angle mode = DEG

->a = atan(1)

->print a

        45.00000

See also

asin, atan, atan2

| HOME | BACK |


ATAN2

| HOME | BACK |

Purpose

To calculate an inverse tangent function, given 2 arguments.   The return is an angle, in a unit set by command "set angle".  This function gives a return angle in a range of -180 to +180 degrees.

The 1st argument is for y coordinate, and the 2nd argument is for x coordinate.  The sign of y and x coordinates are taken into account.  For example if the y coordinate is negative and the x coordinate is also negative, the result angle is in third quadrant.

Usage

{double} ret  =  ATAN2({double} argm1, {double} argm2)

argm1 = y coordinate

argm2 = x coordinate

Example:

->set angle

Angle mode = DEG

->a = atan2(-1,-1)

->print a

     -135.00000

See also

atan

| HOME | BACK |


ATANH

| HOME | BACK |

Purpose

To calculate an inverse hyperbolic tangent function of a number.

Usage

{double} ret  =  ATANH({double} argm1)

argm1 = a number

Example:

->a = atanh(0.5)

->print a

        0.54931

See also

asinh, acosh

| HOME | BACK |


CEILING

| HOME | BACK |

Purpose

To round up to the nearest integer number.

Usage

{double} ret  =  CEILING({double} argm1)

argm1 = a number

Example:

->a = ceiling(15.1)

->print a

       16.00000

->a = ceiling(-15.1)

->print a

      -16.00000

See also

round, fix

| HOME | BACK |


COS

| HOME | BACK |

Purpose

To calculate a cosine function of an angle.  The angle unit in a unit set by command "set angle".

Usage

{double} ret  =  COS({double} argm1)

argm1 = a number

Example:

->set angle

Angle mode = DEG

->a = cos(90)

->print a

        0.00000

See also

sin, tan

| HOME | BACK |


COSH

| HOME | BACK |

Purpose

To calculate a hyperbolic cosine function of an angle.  

            cosh(x) = (exp(x) + exp(-x)) / 2

Usage

{double} ret  =  COSH({double} argm1)

argm1 = a number

Example:

->a = cosh(2)

->print a

        3.76220

See also

sinh, tanh

| HOME | BACK |


COUNT

| HOME | BACK |

Purpose

To count the number of elements, whose values > 0, in a matrix_bln.

Usage

{int} ret  =  COUNT({Matrix_bln} argm1)

argm1 = a Matrix_bln in which elements >0 are counted

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]

->n = count(A>4)          

(Remark:    The expression A>4 return a Matrix_bln object)

->print a

        5

See also

find

| HOME | BACK |


DEG

| HOME | BACK |

Purpose

To convert to a decimal degree.

Usage

{double} ret  =  DEG({double} argm1)

argm1 = a number with a DD.MMSSSSS format

ret   = DD + MM/60 + SS.SSSS / 3600

Example:

->a = deg(20.5013456)

(remark :    this is an angle of 20 deg 50 min 13.456 sec)

->print a

        20.83707

See also

dms

| HOME | BACK |


DMS

| HOME | BACK |

Purpose

To convert to a decimal degree angle to a degree, minute, second angle.  It should be noted that a decimal time can be also convert to hour, minute, and second by using this function.  The result is stored in a string object.

Usage

{String} ret  =  DMS({double} argm1, [{int} argm2] )

argm1 = a decimal degree angle

argm2 = no of decimal digits of second    (default = 1)

Example:

->str1 = dms(13.5, 2)

->print a

 13 30 00.00

See also

deg

| HOME | BACK |


DOUBLE2STR

| HOME | BACK |

Purpose

To convert to a number to a string object.

Usage

{String} ret  =  DOUBLE2STR({double} argm1, [{int} argm2] )

argm1 = a number wanted to convert to a string

argm2 = no of decimal digits (default = current no of "set precision")

Example:

->str1 = double2str(20.05,7)

->print a

20.0500000

See also

dms

| HOME | BACK |


EXP

| HOME | BACK |

Purpose

To calculate a result of the natural log base, e = 2.718281828459045,  raised to the power of a number.

Usage

{double} ret  =  EXP({double} argm1)

argm1 = a number

ret   = eargm1

Example:

->a = exp(5)

->print a

      148.41316

See also

sin, tan

| HOME | BACK |


FACT

| HOME | BACK |

Purpose

To calculate a factorial function of a number.

Usage

{double} ret  =  FACT({double} argm1)

argm1 = a number

ret   = 1* 2 * 3 *...* argm1

Example:

->a = fact(5)

->print a

      120.00000

See also

sin, tan

| HOME | BACK |


FIND

| HOME | BACK |

Purpose

To find indices of elements, whose values > 0, in a Matrix_bln.

Usage

{VecINdx} ret  =  FIND({Matrix_bln} argm1)

argm1 = a Matrix_bln in which indices of elements >0 are to be found

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]

->v = find(A>4)          

(Remark:    The expression A>4 return a Matrix_bln object)

->print v

Vector of Index (row, column)...

list id :    0

Vector size :    5

(1 , 1)
(1 , 2)
(2 , 0)
(2 , 1)
(2 , 2)

See also

findimg, count

| HOME | BACK |


FINDIMG

| HOME | BACK |

Purpose

To find x y coordinates of elements, whose values > 0, in a Image_bln.

Usage

{VecPt2D} ret  =  FINDIMG({Image_bln} argm1)

argm1 = an Image_bln object, in which coordinates of elements >0 are to be found

Example:

->Img = Image(3,3)

->A = [ 1 2 3; 4 5 6; 7 8 9 ]

->Img.matrix() = A

->v = findimg(Img>4)          

(Remark:    The expression Img>4 return a Image_bln object)

->print v

Vec of 2D Point...

list id :    0

Vector size :    5

( 1.500 , 1.500)
( 2.500 , 1.500)
( 0.500 , 0.500)
( 1.500 , 0.500)
( 2.500 , 0.500)

See also

find, count

| HOME | BACK |


FIX

| HOME | BACK |

Purpose

To take away the decimal part of a number, and only leave the integer part.

Usage

{double} ret  =  FIX({double} argm1)

argm1 = a number

Example:

->a = fix(15.8)

->print a

       15.00000

->a = fix(-15.8)

->print a

      -15.00000

See also

round, ceiling

| HOME | BACK |


HSV2RGB

| HOME | BACK |

Purpose

To make a color image, RGB, from Hue (color), Saturation (amount of color) and Value (brightness) Images.

Usage

{Image_rgb} ret  =  HSV2RGB({Matrix_flt} argm1, {Matrix_flt} argm2, {Matrix_flt} argm3)

argm1 = Matrix_flt contains Hue information

argm2 = Matrix_flt contains Saturation information

argm3 = Matrix_flt contains Value information

Example:

->Img_new = HSV2RGB(M_hue, M_sat, M_val)

->

See also

Image_rgb

| HOME | BACK |


INT2STR

| HOME | BACK |

Purpose

To make a string object from an integer number.

Usage

{String} ret  =  INT2STR({int} argm1)

argm1 = an integer number

Example:

->s = int2str(699)

->

See also

double2str

| HOME | BACK |


IS_EVEN

| HOME | BACK |

Purpose

To check whether a number is an even number.

Usage

{bool} ret  =  IS_EVEN({int} argm1)

argm1 = an integer number

Example:

->fact_1 = is_even(699)

->

See also

is_odd

| HOME | BACK |


IS_ODD

| HOME | BACK |

Purpose

To check whether a number is an odd number.

Usage

{bool} ret  =  IS_ODD({int} argm1)

argm1 = an integer number

Example:

->fact_1 = is_odd(699)

->

See also

is_even

| HOME | BACK |


IS_ZERO

| HOME | BACK |

Purpose

To check whether a number is smaller than 1E-15, or 0.000000000000001..

Usage

{bool} ret  =  IS_ZERO({double} argm1)

argm1 = a number

Example:

->fact_1 = is_zero(0.0001)

->

See also

is_odd, is_even

| HOME | BACK |


JD2DATE

| HOME | BACK |

Purpose

To convert a Julian Date number to a Date object.

Usage

{Date} ret  =  JD2DATE({int} argm1)

argm1 = integer number, must be between 2415080 (Mar 1, 1900) and 2488070 (Jan 1, 2100).

Example:

->D1 = jd2date(2420005)

->print D1

25/8/1993 time : 12 00 00.0000

See also

Date

| HOME | BACK |


LN

| HOME | BACK |

Purpose

To calculate a natural logarithm function of a number.

Usage

{double} ret  =  LN({double} argm1)

argm1 = a number

Example:

->a = ln(69.9)

->print a

        4.24707

See also

log, log2

| HOME | BACK |


LOG

| HOME | BACK |

Purpose

To calculate a logarithm function, base 10, of a number.

Usage

{double} ret  =  LOG({double} argm1)

argm1 = a number

Example:

->a = log(69.9)

->print a

        1.84448

See also

ln, log2

| HOME | BACK |


LOG2

| HOME | BACK |

Purpose

To calculate a logarithm function, base 2, of a number.

Usage

{double} ret  =  LOG2({double} argm1)

argm1 = a number

Example:

->a = log2(69.9)

->print a

        6.12722

See also

ln, log

| HOME | BACK |


MAX

| HOME | BACK |

Purpose

To determine the largest number between the two given numbers.

Usage

{double} ret  =  MAX({double} argm1, {double} argm2)

argm1 = a number

argm2 = another number

Example:

->a = max(10,100)

->print a

      100.00000

See also

min

| HOME | BACK |


MIN

| HOME | BACK |

Purpose

To determine the smallest number between the two given numbers.

Usage

{double} ret  =  MIN({double} argm1, {double} argm2)

argm1 = a number

argm2 = another number

Example:

->a = min(10,100)

->print a

       10.00000

See also

max

| HOME | BACK |


NUM2MATRIX

| HOME | BACK |

Purpose

To convert a number to a Matrix object.

Usage

{Matrix} ret  =  NUM2MATRIX({double} argm1)

argm1 = a number

Example:

->A = num2matrix(23.5)

->print A

 no of row    : 1
 no of column : 1

 0:    23.50000

See also

vec2matrix

| HOME | BACK |


PI

| HOME | BACK |

Purpose

To return the value of p, which equals to 3.1415926535897932....

Usage

{double} ret  =  PI()

Example:

->a = pi()

->

See also

 

| HOME | BACK |


RAND

| HOME | BACK |

Purpose

To generate a random number.

Usage

{double} ret  =  RAND([{double} argm1])

argm1 = the maximum possible value of the random number   (default = getrandmax())

Example:

->a = rand()

->

See also

srand, set randmax, getrandmax

| HOME | BACK |


ROUND

| HOME | BACK |

Purpose

To round to the nearest integer number..

Usage

{int} ret  =  ROUND({double} argm1)

argm1 = a number

Example:

->a = round(15.8)

->print a

       16.00000

->a = round(-15.8)

->print a

      -16.00000

See also

fix

| HOME | BACK |


SIN

| HOME | BACK |

Purpose

To calculate a sine function of an angle.  The angle unit in a unit set by command "set angle".

Usage

{double} ret  =  SIN({double} argm1)

argm1 = a number

Example:

->set angle

Angle mode = DEG

->a = sin(90)

->print a

        1.00000

See also

cos, tan

| HOME | BACK |


SINH

| HOME | BACK |

Purpose

To calculate a hyperbolic sine function of an angle.  

            sinh(x) = (exp(x) - exp(-x)) / 2

Usage

{double} ret  =  SINH({double} argm1)

argm1 = a number

Example:

->a = sinh(2)

->print a

        3.62686

See also

cosh, tanh

| HOME | BACK |


SQRT

| HOME | BACK |

Purpose

To calculate a square root of a number..  

Usage

{double} ret  =  SQRT({double} argm1)

argm1 = a number

Example:

->a = sqrt(2)

->print a

        1.41421

See also

 

| HOME | BACK |


SRAND

| HOME | BACK |

Purpose

To initial a new random series.  This function is used associated with function "rand".  

Usage

{void} SRAND([{int} argm1])

argm1 = a number      (default = time())

Example:

->srand(505)

->

See also

rand, time, set randmax

| HOME | BACK |


TAN

| HOME | BACK |

Purpose

To calculate a tangent function of an angle.  The angle unit in a unit set by command "set angle".

Usage

{double} ret  =  TAN({double} argm1)

argm1 = a number

Example:

->set angle

Angle mode = DEG

->a = tan(45)

->print a

        1.00000

See also

atan, atan2

| HOME | BACK |


TANH

| HOME | BACK |

Purpose

To calculate a hyperbolic tangent function of an angle.  

            tanh(x) = sinh(x) / cosh(x)

Usage

{double} ret  =  TANH({double} argm1)

argm1 = a number

Example:

->a = tanh(2)

->print a

        0.96403

See also

cosh, sinh

| HOME | BACK |


TIF2MATRIX

| HOME | BACK |

Purpose

To read a TIF file and save as an Matrix_uch object in a file.

Usage

{void} TIF2MATRIX({String} argm1, {String} argm2)

argm1 = file name of the input tif file

argm2 = file name of the output Matrix_uch file

Example:

->tif2matrix("scene_1.tif", "scene_1")

->

See also

Matrix_uch

| HOME | BACK |


TIME

| HOME | BACK |

Purpose

To give a machine time.  The unit is second.

Usage

{double} ret  =  TIME()

Example:

->a = time()

->print a

998000746.00000

See also

 

| HOME | BACK |