Macro coord2d::new_vector [−][src]
macro_rules! new_vector { () => { ... }; ($start:expr, $end:expr) => { ... }; ($end:expr) => { ... }; }
creating a new Vector
Example
use coord2d::*; fn main () { let a: coords::Coord = new_coord!(1, 2.0); let b: coords::Coord = new_coord!(0.4, 3.3); let h:vectors::Vector = new_vector!(a, b); println!("{:?}", h); }
- the var h contains to var start point and end point point
- while magnitude get calculated automatically