|
|
Purpose
To get a value of an element at a particular index in a Vector. The return result is a IdPt2D object.
The first element index is 0, and the last one is n-1, where n is no of total elements.
Class
VecIdPt2D
Usage
{IdPt2D} ret = object({int} argm1)
argm1 = index number
Example:
->v = VecIdPt2D(5) ->v.pushback(IdPt2D(1,10,20)) ->v.pushback(IdPt2D(2,10,30)) ->v.pushback(IdPt2D(3,10,40)) ->print v |
See also (class function)
init
Purpose
To perform 2D affine coordinate transformation.
The mathematic model is as follow:
x_new = a*x_old + b*y_old + Cx
y_new = c*x_old + d*y_old + Cy
If the value of standard deviation of the old system, right side of the equation, is zero, the right hand side coordinate system will be kept fix. If it is not zero, an appropriate value of standard deviation of the left hand side coordinate system is essential.
Standard deviation of coordinates of the left hand side coordinate system must be always given, otherwise a default value will be used.
The calling Vector, VecIdPt2D, is treated as coordinates in the OLD system. The corresponding coordinate in the new system is given as an argument in the function.
Upon request, an ASCII text file is generated after the calculation is done. Also a matrix containing transformation parameters and all related information are return to the user. This matrix is is actually where the information in the report is from.
Return matrix consists of (from left to right)
-parameter vector (a, b, c, d, Cx, Cy)
-residual vector (v1, v2, ..., vn)
-Rms value (one single value)
-nverse of Normal matrix (covariance matrix
of parameters)
-point number
By comparing the returning matrix to the report, the user can easily figure out what output information is represented by which part of the matrix.
Class
VecIdPt2D
Usage
{Matrix} ret = object.AFFINE({int} argm1,[{int} argm2])
argm1 = list of point with ID and SD, in the new coordinate system
argm2 = output file (if not given, there will be no output file)
Example:
->M = v.affine(v1, "my_report") -> |
See also (class function)
conformal, poly2nd, pjtive
Purpose
To compute area of a polygon, sequentially constructed by all points in the calling object.
Class
VecIdPt2D
Usage
{double} ret = object.AREA()
Example:
->v = VecIdPt2d(5) ->v.pushback(Idpt2d(1,10,20)) ->v.pushback(Idpt2d(2,10,30)) ->v.pushback(Idpt2d(3,60,40)) ->v 250.00000 -> |
See also (class function)
Purpose
To perform 2D conformal coordinate transformation.
The mathematic model is as follow:
x_new = a*x_old + b*y_old + Cx
y_new = -b*x_old + a*y_old + Cy
If the value of standard deviation of the old system, right side of the equation, is zero, the right hand side coordinate system will be kept fix. If it is not zero, an appropriate value of standard deviation of the left hand side coordinate system is essential.
Standard deviation of coordinates of the left hand side coordinate system must be always given, otherwise a default value will be used.
The calling Vector, VecIdPt2D, is treated as coordinates in the OLD system. The corresponding coordinate in the new system is given as an argument in the function.
Upon request, an ASCII text file is generated after the calculation is done. Also a matrix containing transformation parameters and all related information are return to the user. This matrix is is actually where the information in the report is from.
Return matrix consists of (from left to right)
-parameter vector (a, b, Cx, Cy)
-residual vector (v1, v2, ..., vn)
-Rms value (one single value)
-nverse of Normal matrix (covariance matrix
of parameters)
-point number
By comparing the returning matrix to the report, the user can easily figure out what output information is represented by which part of the matrix.
Class
VecIdPt2D
Usage
{Matrix} ret = object.CONFORMAL({int} argm1,[{int} argm2])
argm1 = list of point with ID and SD, in the new coordinate system
argm2 = output file (if not given, there will be no output file)
Example:
->M = v.conformal(v1, "my_report") -> |
See also (class function)
affine, poly2nd, pjtive
Purpose
To increase the maximum size of the vector by a given number.
Class
VecIdPt2D
Usage
{void} object.EXTEND({int} argm1)
argm1 = number of elements wanted to extend
Example:
->v = VecIdPt2D(5) ->v.maxsize() ->v.maxsize() |
See also (class function)
maxsize, truncate
Purpose
To find in a vector object a particular value of element. This function only compares the ID number of points. It does not take into account values of x y coordinates.
The return result is an index of the vector, if found, otherwise it returns -1.
Class
VecIdPt2D
Usage
{int} ret = object.FIND({IdPt2D} argm1)
argm1 = value of an element wanted to find
Example:
->v |
See also (class function)
qfind
Purpose
To report the current ID of the vector.
Class
VecIdPt2D
Usage
{int} ret = object.ID()
Example:
->v = VecIdPt2D(5) ->v.id() |
See also (class function)
maxsize, truncate, extend
Purpose
To initialize a vector object.
Please be aware that once the vector is initialized, it is still empty. Only its maximum number of element in the vector is declared. Use function "pushback" to insert element into a vector.
Class
VecIdPt2D
Usage
{void} object.INIT({int} argm1)
argm1 = number of maximum elements in the vector
Example:
->v = VecIdPt2D() ->v.init(500) -> |
See also (class function)
pushback
Purpose
To read data from an ASCII file and stored in a VecIdPt2D object.
If file name extension is omitted, the function will add default extensions to the files. The default extension of an ASCII data file is ".txt".
Unless the path name is given in the file names, the function will search for the files in the current working directory, defined by command "set path".
It is important to make sure that the each line in the file has only 3 or 4 fields, the first is read as index ID, the second and the third are x and y coordinates. The fourth field, if any, is standard deviation. All of them are separated by at least one blank, a white space, ASCII 32.
It is possible to have a comment line in the data file, by inserting a slash sign, "/", in front of a line. Comment lines will not be read by the function.
Class
VecIdPt2D
Usage
{void} object.LOAD({String} argm1)
argm1 = data filename (default extension is ".txt")
Example:
->v = VecIdPt2D() ->v.load("my_data") -> |
See also (class function)
save
Purpose
To search for a particular ID block number, then read a block of data out from an ASCII file and stored in a VecIdPt2D object.
If file name extension is omitted, the function will add default extensions to the files. The default extension of an ASCII data file is ".txt".
Unless the path name is given in the file names, the function will search for the files in the current working directory, defined by command "set path".
Each line in the data file can either has one field or two fields. If it has 2 fields, they are separated by at least one blank, a white space, ASCII 32, and the first one is read as row number, while the second one is column number. A line with one field is interpreted as an ID.
An example of data is:
|
By using this function "loadsch", it is possible to store separate sets of data in one file, and be able to extract a particular data set within that file. Each data set must have its own unique ID, for example 101, 102, 103 (see example above).
It is possible to have a comment line in the data file, by inserting a slash sign, "/", in front of a line. Comment lines will not be read by the function.
Class
VecIdPt2D
Usage
{void} object.LOADSCH({String} argm1,
{int} argm2)
argm1
= data filename (default extension is ".txt")
argm2
= Block ID (default is the
calling vector block ID)
Example:
->v = VecIdPt2D() ->v.loadsch("my_data", 101) ->print v 1 ( 10.000 , 20.000) 0.100 |
See also (class function)
load
Purpose
To convert to a Matrix object.
This function creates a Matrix of size n rows by 4 columns, where n is number of indices in the vector.
Class
VecIdPt2D
Usage
{Matrix} ret = object.MATRIX()
Example:
->v ->print M |
See also (class function)
Purpose
To compute the maximum value of elements in the vector.
The return result is a Pt2D object, where the x coordinate is the maximum value of x coordinates, and y coordinate is that of y coordinates.
Class
VecIdPt2D
Usage
{Pt2D} ret = object.MAX()
Example:
->v |
See also (class function)
min, mean
Purpose
To report the maximum size of the vector. This is the maximum number of elements that can be stored in the vector.
Class
VecIdPt2D
Usage
{int} ret = object.MAXSIZE()
Example:
->v = VecIdPt2D(5) ->v.maxsize() |
See also (class function)
size, truncate, extend
Purpose
To compute the mean value of indices in the vector.
The return result is a Pt2D object, where the x coordinate is the mean value of x coordinates, and y coordinate is that of y coordinates.
Class
VecIdPt2D
Usage
{Pt2D} ret = object.MEAN()
Example:
->v |
See also (class function)
min, max
Purpose
To compute the minimum value of elements in the vector.
The return result is a Pt2D object, where the x coordinate is the minimum value of x coordinates, and y coordinate is that of y coordinates.
Class
VecIdPt2D
Usage
{Pt2D} ret = object.MIN()
Example:
->v |
See also (class function)
max, mean
Purpose
To search for points that are nearest to a given point.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.NEAREST({double} argm1,{double} argm2,{int} argm3)
argm1 = given x coordinate
argm2 = given y coordinate
argm3 = no of points being wanted
Example:
->print v |
See also (class function)
Purpose
To perform 2D projective coordinate transformation.
The mathematic model is as follow:
x_new = (a1*x_old + a2*y_old + a3) / (c1*x_old + c2*y_old + 1)
y_new = (b1*x_old + b2*y_old + b3) / (c1*x_old + c2*y_old + 1)
If the value of standard deviation of the old system, right side of the equation, is zero, the right hand side coordinate system will be kept fix. If it is not zero, an appropriate value of standard deviation of the left hand side coordinate system is essential.
Standard deviation of coordinates of the left hand side coordinate system must be always given, otherwise a default value will be used.
The calling Vector, VecIdPt2D, is treated as coordinates in the OLD system. The corresponding coordinate in the new system is given as an argument in the function.
Upon request, an ASCII text file is generated after the calculation is done. Also a matrix containing transformation parameters and all related information are return to the user. This matrix is is actually where the information in the report is from.
Return matrix consists of (from left to right)
-parameter vector (a1, a2, a3, b1, b2, b3, c1, c2)
-residual vector (v1, v2, ..., vn)
-Rms value (one single value)
-nverse of Normal matrix (covariance matrix
of parameters)
-point number
By comparing the returning matrix to the report, the user can easily figure out what output information is represented by which part of the matrix.
Class
VecIdPt2D
Usage
{Matrix} ret = object.PJTIVE({int} argm1,[{int} argm2])
argm1 = list of point with ID and SD, in the new coordinate system
argm2 = output file (if not given, there will be no output file)
Example:
->M = v.pjtive(v1, "my_report") -> |
See also (class function)
conformal, poly2nd, affine
Purpose
To perform 2D polynomial second degree coordinate transformation.
The mathematic model is as follow:
x_new = a*x_old^2 + b*y_old^2 + c*x_old + d*y_old + e*x_old*y_old + Cx
y_new = aa*x_old^2 + bb*y_old^2 + cc*x_old + dd*y_old + ee*x_old*y_old + Cy
If the value of standard deviation of the old system, right side of the equation, is zero, the right hand side coordinate system will be kept fix. If it is not zero, an appropriate value of standard deviation of the left hand side coordinate system is essential.
Standard deviation of coordinates of the left hand side coordinate system must be always given, otherwise a default value will be used.
The calling Vector, VecIdPt2D, is treated as coordinates in the OLD system. The corresponding coordinate in the new system is given as an argument in the function.
Upon request, an ASCII text file is generated after the calculation is done. Also a matrix containing transformation parameters and all related information are return to the user. This matrix is is actually where the information in the report is from.
Return matrix consists of (from left to right)
-parameter vector (a, b, c, d, e, aa, bb, cc, dd, ee, Cx, Cy)
-residual vector (v1, v2, ..., vn)
-Rms value (one single value)
-nverse of Normal matrix (covariance matrix
of parameters)
-point number
By comparing the returning matrix to the report, the user can easily figure out what output information is represented by which part of the matrix.
Class
VecIdPt2D
Usage
{Matrix} ret = object.POLY2ND({int} argm1,[{int} argm2])
argm1 = list of point with ID and SD, in the new coordinate system
argm2 = output file (if not given, there will be no output file)
Example:
->M = v.poly2nd(v1, "my_report") -> |
See also (class function)
conformal, pjtive, affine
Purpose
To insert an IdPt2D in a vector object. A new element will be insert at the last available index in the vector.
Suppose the vector has already 4 element in it, when a new element is inserted, the size is updated to 5 and the new element is stored at index number 4. The first element index is 0, and the last one is n-1, where n is no of total elements.
Class
VecIdPt2D
Usage
{void} object.PUSHBACK({IdPt2D} argm1)
argm1 = an 2D point with ID being inserted
Example:
->v = VecIdPt2D(5) ->v.pushback(IdPt2D(1,10,20)) ->v.pushback(IdPt2D(2,10,30)) ->v.pushback(IdPt2D(3,10,40)) ->print v -> |
See also (class function)
init
Purpose
To find in a vector object a particular value of element. This function expects that the content of the vector is already sorted, or otherwise it will not work correctly.
This function only compares the ID number of the index. It does not take into account values of x y coordinates.
It performs a binary searching which is much faster than using the function "find".
The return result is an index of the vector, if found, otherwise it returns -1.
Class
VecIdPt2D
Usage
{int} ret = object.FIND({IdPt2D} argm1)
argm1 = value of an element wanted to find
Example:
->v = VecIdPt2D(5) ->v.pushback(IdPt2d(3,100,400)) ->v.pushback(IdPt2d(2,100,300)) ->v.pushback(IdPt2d(1,100,200)) ->print v ->v1.qfind(Idpt2D(2,0,0)) |
See also (class function)
find
Purpose
To empty the content of the vector.
This function can be used to reset the vector very quick. It simply sets the size of the vector to zero. It does not do any memory initialization.
Class
VecIdPt2D
Usage
{void} object.REMALL()
Example:
->v = VecIdPt2D(5) ->v.pushback(IdPt2D(1,10,20)) ->v.pushback(IdPt2D(2,10,30)) ->v.pushback(IdPt2D(3,10,40)) ->print v ->v.remall() ->print v -> |
See also (class function)
remove, remsort
Purpose
To remove an element at a particular index out of the vector.
This function replaces the content at the required index with the last element, and simply reduces the size of the vector by 1.
Class
VecIdPt2D
Usage
{void} object.REMOVE({int} argm1)
argm1 = index at which the element being removed
Example:
->v ->v |
See also (class function)
remall, remsort
Purpose
To remove a group of elements, specified by a starting index and ending index, out of the vector. This function will fill up the gap by shift the rest of the content of the vector forward.
Class
VecIdPt2D
Usage
{void} object.REMSORT({int} argm1,[{int} argm1])
argm1 = start index at which the element being removed
argm2 = ending index at which the element being removed
(default = the same index as the start index)
Example:
->v = VecIdPt2D(5) ->v.pushback(IdPt2d(3,100,400)) ->v.pushback(IdPt2d(2,100,300)) ->v.pushback(IdPt2d(1,100,200)) ->print v ->v |
See also (class function)
remall, remove
Purpose
To save as ASCII format. Each line in the output file represents an element in the vector.
if a file name extension is not given, the function assumes an extension of ".txt".
if a path name is not include in the specified file name, the function will search in the current data path, set by command "set path".
Class
VecIdPt2D
Usage
{void} object.SAVE({String} argm1)
argm1 = output file name
Example:
->v.save("my_data") |
See also (class function)
load, loadsch
Purpose
To set the value of standard deviation of all elements in a vector.
Class
VecIdPt2D
Usage
{void} object.SET_SD({double} argm1)
argm1 = value of standard deviation being set
Example:
->v ->v |
See also (class function)
SCALE
Purpose
To multiply coordinates of all point in the vector by constants.
Class
VecIdPt2D
Usage
{void} object.SCALE({double} argm1,{double} argm2)
argm1 = scale in x direction
argm2 = scale in y direction
Example:
->v ->v |
See also (class function)
SHIFT
Purpose
To shift the coordinates by a specific amount in x and y direction.
Class
VecIdPt2D
Usage
{void} object.SHIFT({double} argm1,{double} argm2)
argm1 = shift in x direction
argm2 = shift in y direction
Example:
->v ->v |
See also (class function)
Purpose
To report the current size of the vector. This is the current number of elements in the vector.
Class
VecIdPt2D
Usage
{int} ret = object.SIZE()
Example:
->v = VecIdPt2D(5) ->v.size() |
See also (class function)
maxsize, truncate, extend
Purpose
To sort elements of a vector by using Shell sort.
Elements in a vector are sorted by their ID numbers.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.SORT()
Example:
->v ->v1 |
See also (class function)
qfind
Purpose
To sort elements of a vector by using Shell sort.
Elements in a vector are sorted by their x coordinates.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.SORT_X()
Example:
->v ->v1 |
See also (class function)
sort
Purpose
To swap x and y coordinates of all points in the vector.
Class
VecIdPt2D
Usage
{void} object.SWAP_XY()
Example:
->print v ->print v |
See also (class function)
shift
Purpose
To transform coordinates of points in the calling object, to a new system using a set of given transformation parameters.
The type of transformation depends on the number of parameters given by the user.
If the number of parameters is 4, the transformation type is "conformal".
If the number of parameters is 6, the transformation type is "affine".
If the number of parameters is 8, the transformation type is "projective".
If the number of parameters is 12, the transformation type is "polynomial 2nd degree".
The order of parameters will be the same as that in the transformation report, generated by function "conformal", "affine", "pjtive" and "poly2nd".
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.TRANSFORM({Vector} argm1)
argm1 = list of transformation parameters
Example:
->Vec_new = v.transform(para) -> |
See also (class function)
conformal, affine, poly2nd, pjtive
Purpose
To trim out all the empty space of the current vector.
Suppose a vector has 5 elements in it, and its max size is 500, once it is trimmed, the max size is reduced to 5. This function does a new memory initialization.
Class
VecIdPt2D
Usage
{void} object.TRUNCATE()
argm1 = number of elements wanted to extend
Example:
->v = VecIdPt2D(5) ->v.maxsize() ->v.maxsize() |
See also (class function)
maxsize, extend
Purpose
To extract a portion of a vector, specified by a starting index and ending index.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.WINDOW({int} argm1,{int} argm2)
argm1 = start index at which the element being extracted
argm2 = ending index at which the element being extracted
Example:
->print v ->print v1 |
See also (class function)
window_x, window_xy
Purpose
To extract indices that fall within a window range, specified by the starting and ending x coordinates.
This is a one dimensional search.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.WINDOW_X({double} argm1,{double} argm2)
argm1 = start x coordinate of the window
argm2 = end x coordinate of the window
Example:
->print v ->print v1 |
See also (class function)
window, window_xy
Purpose
To extract indices that fall within a window, specified by x y coordinates of the lower left and upper right of the window.
This is a two dimensional search.
Class
VecIdPt2D
Usage
{VecIdPt2D} ret = object.WINDOW_XY({double} argm1,{double} argm2,{double} argm3,{double} argm4)
argm1 = x coordinate of the lower left corner of window
argm2 = y coordinate of the lower left corner of window
argm3 = x coordinate of the upper right corner of window
argm4 = y coordinate of the upper right corner of window
Example:
->print v ->print v1 |
See also (class function)
window, window_x