Function coord2d::vectors::new[][src]

pub fn new(start: Coord, end: Coord) -> Vector

creating a new Coord

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