Skip to content

Linear algebra header library in C for connect my mat and vec library

License

Notifications You must be signed in to change notification settings

domonkosgyomorey/LAL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Linear algebra library for connect vec.h and mat.h

The example code

#define LAL_IMPL
#include "lal.h"

int main(){
    Mat mat = mat_alloc(2, 2);
    mat_put(mat, (double[]){2,0,0,1}, 4);

    Vec pos = vec_alloc(2);
    vec_put(pos, (double[]){1, 1}, 2);
    
    printf("Transformation matrix:\n");
    mat_print(mat); 
    printf("\n");

    printf("Posizion vector:\n");
    vec_print(pos);
    printf("\n");

    printf("Transformed position:\n");
    vec_print(lal_vec_transform(pos, mat));
    printf("\n");

    Vec vecs[] = {
        pos,
        pos,
        pos,
        pos,
    };
    Vec* result = lal_vecs_transform(vecs, 4, mat);
    for(ll i = 0; i < 4; i++){
        vec_print(result[i]);
    }
    return 0;
}

Compile and run

make
./main.exe

Rederences

my Vec library.

my Mat library.

About

Linear algebra header library in C for connect my mat and vec library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published