# points Data structure for representing a pair of coordinates of float type. The structure supports the same sets of linear algebra operation from vectors for a **R²** space: * **Point addition** * **Scalar point addtition** * **Point subtraction** * **Scalar point subtraction** * **Point scalar multiplication** * **Point scalar division** * **Euclidean distance** * **Squared euclidean distance** * **Euclidean norm** ## Usage * **Install** ``` cargo add points ``` * **Expressions** ```rust // execute (a + b) * 3 + (a - c) let p1: Point = Point::default(); let p2 = Point::new(1.0, 3.0); let p3 = Point::new(1.5, 2.5); let result = (p1 + p2) * 3.0 + (p1 - p3); assert_eq!(Point::new(1.5, 6.5), result); // squared euclidean distance let p1 = Point::new(1.0, 3.0); let p2 = Point::new(1.5, 2.0); let expected = 1.25; let result = p1.squared_distance_to(p2); assert_eq!(expected, result); // euclidean distance let p1 = Point::new(1.0, 3.0); let p2 = Point::new(1.5, 2.0); let expected = 1.118033988749895; let result = p1.distance_to(p2); assert_eq!(expected, result); ```