https://github.com/jakeroggenbuck/vector-c
Vector math in C
https://github.com/jakeroggenbuck/vector-c
Last synced: 4 months ago
JSON representation
Vector math in C
- Host: GitHub
- URL: https://github.com/jakeroggenbuck/vector-c
- Owner: JakeRoggenbuck
- License: gpl-3.0
- Created: 2024-02-11T23:02:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-29T09:37:09.000Z (6 months ago)
- Last Synced: 2025-01-07T16:20:14.228Z (6 months ago)
- Language: C
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vectors-c


[](https://github.com/JakeRoggenbuck?tab=repositories&q=&type=&language=c&sort=stargazers)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;
}
```