This is the Simu1 Library version 0.1.0.
Libsimu1 was initially written to simulate the NMR behavior of a 1-spin system under free evolution or radio-frequency pulse action. It was used to draw Grapefruit Plots.
Libsimu1 is able to compute the matrix that is associated to a rotation of given angle and axis, and to apply it to a vector.
This is a C API. The user has to write a C program to use it. A simple executable program named demo can be built from the distribution file. The demo.c file provides an example of libsimu1 use.
The 120.0 degrees rotation
around the (1.0 1.0 1.0) axis
transforms the (0.0 0.0 1.0) vector
into the (1.0 -0.0 0.0) vector.
defines two data types:
double Mat33. It is used to store the matrix of a rotation in a 3D vector space.
double Vec3. It describes a vector of the physical 3D space.
and two functions:
void matrot(Mat33 r, Vec3 axis, double angle)computes the matrix m of the rotation that is defined by its angle, in radians, and its axis. The latter is defined by axis, a unitaryvector. Libsimu1 will not normalize axis for you. A non-normalized axis vector produces a wrong rotation matrix. You have been warned.
void matvec(Mat33 r, Vec3 v1, Vec3 v2)applies the rotation of matrix r to vector v1 to give vector v2. v1 and v2 parameters may be identical.
The Simu1b Library has many more features.
March 31st 2006