#![allow(unused_imports)] use num_bigint::BigInt; use num_rational::BigRational; use num_traits::cast::FromPrimitive; // use num_rational::BigRational; // use num_traits::Num; // use num_traits::Zero; // use rand::distributions::Standard; // use rand::Rng; // use rgeometry::transformation::*; use rgeometry::data::*; use rgeometry::*; // use std::ops::Mul; // use std::ops::Neg; // use std::ops::Sub; // pub fn test_sub(p: &Point, q: &Point) -> Vector // where // T: Num + Clone + PartialOrd, // for<'a> &'a T: Sub + Mul + Neg, // { // p - q // } fn main() { let pt = Point::new([1, 2]); dbg!(pt.y_coord()); // let t1 = Transform::translate(Vector([BigInt::from(1), BigInt::from(2), BigInt::from(3)])); // let t2 = Transform::scale(Vector([BigInt::from(-1), BigInt::from(1), BigInt::from(2)])); // let v = Vector([BigInt::from(4), BigInt::from(5), BigInt::from(6)]); // dbg!(&v); // dbg!(&t1 * &v); // dbg!(&t2 * &v); // dbg!((&t2 * &t1) * &v); let p = Polygon::new(vec![ Point::new([0, 0]), Point::new([1, 0]), Point::new([3, 3]), // Point::new([0, 1]), ]) .unwrap(); let p2: Polygon = p.cast(); dbg!(p2.centroid()); // let a: Array2 = unimplemented!(); // let b = array![7, 8, 9]; // // let c: Array2 = arr1(&b); // dbg!(a.dot(&b)); // let m = vec![vec![1, 2, 3], vec![4, 5, 6]]; // let v = vec![7, 8, 9]; // dbg!(mult_mv::(m, &v)); // let p = Point([1, 2]); // // println!("p: {:?}", &p); // let t1 = Transform::translation(Vector([1, 1])); // let t2 = Transform::scaling(Vector([2, -1])); // // println!("t: {:?}", &t); // let tp = (t2 * t1) * p; // println!("tp: {:?}", &tp); // let a = Point([1, 2]); // let b = Vector([3, 4]); // let c = &a + &b; // println!("Output: {:?}", c); // let p: Point = Point3::new(1., 2., 3.0); // let x: SVector = Vector3::new(1.0, 2.0, 3.0); // let t1: Transform = Transform::identity(); // let t2: Transform = t1 * Translation3::new(1.0, 2., 3.); // let t3: Transform = Transform::identity(); // let t4: &OMatrix, Const<4>> = t3.matrix(); // let t5: Transform = Transform::from(t4); // let t6: SVector = Vector3::new(1, 2, 3); // let t7: SVector = Vector3::new(BigInt::from(2), BigInt::from(3), BigInt::from(4)); // let t8 = Matrix3::from_diagonal_element(1); // let t9: Transform = translation(x); // let t10 = scaling(x); // println!("N: {:?}", &t9); // println!("Output: {:?}", t9 * p); }