Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/katebea/vector3d
Some three dimensional vector stuff
https://github.com/katebea/vector3d
Last synced: about 5 hours ago
JSON representation
Some three dimensional vector stuff
- Host: GitHub
- URL: https://github.com/katebea/vector3d
- Owner: kateBea
- Created: 2022-10-29T23:55:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T15:41:46.000Z (over 1 year ago)
- Last Synced: 2023-03-26T14:37:15.145Z (over 1 year ago)
- Language: C
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vector3D
Some three dimensional vector stuff. Latest addition is rotation in 3D space, requires two elements, **rotation axis** and the **angle**. The later could be in either degree or radians, just need to specify so to any of the functions to rotate a vector. Threre's six functions to rotate vectors in total, three of them assume the unitary vector for the specific axis (``[1, 0, 0]`` for X axis, ``[0, 1, 0]`` for Y axis and ``[0, 0, 1]`` for Z axis), the other three may take an arbitrary vector for the rotation axis (not implemented yet).# Example execution:
```
******* VECTOR ROTATION *******
vector coordinates [x, y, z]: 1 0 0
[1.000000, 0.000000, 0.000000]
1. Rotate X axis [X]
2. Rotate Y axis [Y]
3. Rotate Z axis [Z]
4. Exit [E]
Axis: Z
Angle: 3.7
Is the angle in degrees? [Y/Yes] : [N/No] -> No
[-0.848100, -0.529836, 0.000000]vector coordinates [x, y, z]: 1 0 0
[1.000000, 0.000000, 0.000000]
1. Rotate X axis [X]
2. Rotate Y axis [Y]
3. Rotate Z axis [Z]
4. Exit [E]
Axis: Z
Angle: 2.8
Is the angle in degrees? [Y/Yes] : [N/No] -> No
[-0.942222, 0.334988, 0.000000]
```# Visualization:
Corresponds to the piece of execution above.![rotate Z axis 3.7 rad](/img/img1.png)
![rotate Z axis 2.8 rad](/img/img2.png)
Images source:
[GeoGebra](https://www.geogebra.org/m/Fy7UruJa)