Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakeroggenbuck/vector-c
Vector math in C
https://github.com/jakeroggenbuck/vector-c
Last synced: 5 days ago
JSON representation
Vector math in C
- Host: GitHub
- URL: https://github.com/jakeroggenbuck/vector-c
- Owner: JakeRoggenbuck
- Created: 2024-02-11T23:02:26.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-01T03:26:16.000Z (7 months ago)
- Last Synced: 2024-05-02T18:07:23.495Z (7 months ago)
- Language: C
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vectors-c ![Build](https://img.shields.io/github/actions/workflow/status/jakeroggenbuck/all-the-NaN-floats/c-cpp.yml?branch=main&style=for-the-badge)
Vector math in C```c
int main() {
struct Vec3 *v = build_vec3(1, 2, 3);
struct Vec3 *u = build_vec3(4, 5, 6);double res = dot_vec3(v, u);
// (1*4) + (2*5) + (3*6)
assert(res == 4 + 10 + 18);struct Vec2 *a = build_vec2(1, 2);
struct Vec2 *b = build_vec2(3, 4);double res2 = dot_vec2(a, b);
// (1*3) + (2*4)
assert(res2 == 3 + 8);interactive();
return 0;
}
```