#three #systems #coordinate #graphics #magnitude #dimensional #vector2

coordinates

Simple, no nonsense, library for using two and three dimensonal coordinates in several systems

6 releases (3 breaking)

new 0.4.0 Jan 10, 2025
0.3.1 Sep 24, 2022
0.2.0 Aug 16, 2022
0.1.1 Aug 5, 2022

#568 in Math

Download history 49/week @ 2024-09-20 14/week @ 2024-09-27 11/week @ 2024-10-18 85/week @ 2024-10-25 4/week @ 2024-11-01 1/week @ 2024-11-08 33/week @ 2024-12-27 41/week @ 2025-01-03

74 downloads per month

MIT-0 OR 0BSD

54KB
1.5K SLoC

Coordinates.rs

Getting started

Add the following to your cargo.toml under [dependencies]

coordinates = "0.4.0"

If you want additional features — like serializing and deserializing — your [dependencies] line will look more like this

coordinates = { version = "0.4.0", features = ["serde"] }

In a file import the coordinate system you want, or all of them through coordinates::prelude::*

use coordinates::two_dimensional::Vector2;

If you want extra traits, such as magnitude or dot products you will also need to include the following

use coordinates::traits::*;

And finally initialize a variable

let var = Vector2 {
  x: 0.0,
  y: 1.0,
}

Acknowledgements

  • rsekman, for contributing multiple PRs to the repo, and helping me refactor and track down a bug for version 0.4.0

Dependencies

~245–455KB