title: Idiomatic way to declare 2D, 3D vector types in Rust?
body: <p>I'm looking to write some small library that use 2D and 3D points or directions in space <br>(vector in vector/matrix sense, not Rust's <code>Vec</code>).</p>
  
  <p>Rust doesn't impose rules here, so you can make a tuple of floats, or a new <code>struct</code> with <code>x, y, z</code> members. or a single <code>data: [f64; 3]</code> member.</p>
  
  <p>The reason I'd like to define a type here instead of using <code>[f64; 3]</code>, is so I can declare methods such as <code>length</code>, <code>normalized</code>, also <code>Add</code>, <code>Sub</code> operators.</p>
  
  <p>Whats a good basis to declare small 2D - 3D fixed sized data types on?</p>
  
  <hr>
  
  <p>Note, while there are good existing libraries, I'd like to write my own since it only needs some basic operations, and I like to understand whats going on internally.</p>