Home
 |  
Research
 |  
Education
 |  
Publications
 |  
Products
 |  
Free Softwares
[Japanese]
Free Softwares
-
nkjLib:
Navigation Kernel and Job control LIBrary
(Copyright 2000 by Yoshikazu Nakajima)
[Features]
Smart programming with "operator" description is available.
Currently, this library is partly distributed for geometric operations.
[
Download from Vector
]
(Environment:WindowsXP & VC++6.0.Archive type:LZH.)
[General Information and Restrictions]
NkjLib is a public domain software.
No restriction to use while you keep the usage regulations which are described in nkjLib documents.
I am happy if this software were useful for your work
and you would indicate nkjLib contribution in your documents.
Author has no responsibility on any damage which might be caused by installation and usage of this software.
Send problem reports to
nakajima@bioeng.t.u-tokyo.ac.jp.
Please do not send me large attachments unless I specifically ask for them.
[Distribution]
To distribute nkjLib, include the original and unchanged archive.
If you want to append some additional packages,
please include the document which describes additional part clearly.
[Sample source]
# NOTICE: To explain in brief, this sample source does not include error handle processing.
=== Load data of 3-D points and matrices, and do some operations, and save results ===
//
// Link: nkjlib.lib
//
#include < stdio.h >
#include "nkjlib.h"
void main()
{
// Load 3-D points from a file, and print
//
nkjPoint3D point;
point.Load("point1.dat");
point.Print("Point 1"); // Print with a title
// Load a matrix from a file, and print
//
nkjMatx4x4 matx1;
matx1.Load("matrix1.dat");
matx1.Print("Matrix 1"); // Print with a title
// Create a matrix and print
//
nkjMatx4x4 matx2;
matx2[0][0] = 0.0; matx2[0][1] = 0.0; matx2[0][2] = 1.0; matx2[0][3] = 0.0;
matx2[1][0] = 1.0; matx2[1][1] = 0.0; matx2[1][2] = 0.0; matx2[1][3] = 0.0;
matx2[2][0] = 0.0; matx2[2][1] = 1.0; matx2[2][2] = 0.0; matx2[2][3] = 0.0;
matx2[3][0] = 0.0; matx2[3][1] = 0.0; matx2[3][2] = 0.0; matx2[3][3] = 1.0;
matx2.Print(); // Print without title
// Matrix operations, matrix-point operations
//
// !(matrix) : Inverse
// ~(matrix) : Transpose
//
// (new matrix) = (matrix1) * (inversed matrix of matrix2)
//
// (new point) = (inversed matrix of matrix2) * (transposed matrix of matrix1) * (matrix2) * (point)
//
nkjMatx4x4 newmatx;
newmatx = matx1 * !matx2;
newmatx.Print("New matrix");
newmatx.Save("output.mtx");
nkjPoint3D newpoint = !matx2 * ~matx1 * matx2 * point;
newpoint.Print("Point");
newpoint.Save("output.dat");
}
===
[Top]
[[Home]]