| Crates.io | vector2 |
| lib.rs | vector2 |
| version | 0.1.5 |
| created_at | 2023-08-23 03:57:33.667275+00 |
| updated_at | 2023-08-28 01:59:14.260363+00 |
| description | A simple 2D vector library |
| homepage | |
| repository | https://github.com/tz629/vector2 |
| max_upload_size | |
| id | 951544 |
| size | 10,596 |
Vector2 is a simple library for using and creating 2D vectors.
use vector2::Vector2;
// Create a Vector2
let vector2 = Vector2::new(1.0, 0.5);
// (1.0, 0.0)
let other = Vector2::RIGHT;
// Add two Vector2s
let added = vector2 + other;
assert_eq!(added.x, 2.0);
assert_eq!(added.y, 0.5);