Skip to content

A simple all in one header file implementation of mathematical vector calculations.

License

Notifications You must be signed in to change notification settings

AMAIOLAMO/cxvec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CX VEC

this is a header only library intended for vector linear algebra. It should work for both C and C++.

C++ should have their respective operator overloads. (this expects the __cplusplus macro to be defined) (however this will change in the future, as instead, you can define CX_OP_OVERLOAD macro instead to freely support)

how to use

Simply clone this repository, and copy the cxvec.h file into your project.

normally the header file acts as a definition only file unless macro the CXVEC_IMPL_ONCE has been defined.

examples of this:

#include <stdio.h>

#include "cxvec.h"

int main(void) {
    Vec3f pt1 = {0f, -2.1f, 30.0f};

    Vec3f pt2 = {20f, 0f, 0f};

    Vec3f result = Vec3f_add(pt1, pt2);

    printf("result: ");
    Vec3f_fprint(result); // output: <20.00, -2.10, 30.00>

    return 0;
}

more functions shown in the header file. (may be documented here in the future)

LICENSED UNDER MIT-No-Attribution

About

A simple all in one header file implementation of mathematical vector calculations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages