Macro pix_engine::tri [−][src]
macro_rules! tri {
($p1 : expr, $p2 : expr, $p3 : expr $(,) ?) => { ... };
($x1 : expr, $y1 : expr, $x2 : expr, $y2 : expr, $x3 : expr, $y3 : expr $(,)
?) => { ... };
($x1 : expr, $y1 : expr, $z1 : expr, $x2 : expr, $y2 : expr, $z2 : expr, $x3 :
expr, $y3 : expr, $z3 : expr $(,) ?) => { ... };
}
Expand description
Constructs a Triangle with three points.
let t = tri!([10, 20], [30, 10], [20, 25]);
assert_eq!(t.as_array(), [
point!(10, 20),
point!(30, 10),
point!(20, 25),
]);
let t = tri!([10, 20, 10], [30, 10, 40], [20, 25, 20]);
assert_eq!(t.as_array(), [
point!(10, 20, 10),
point!(30, 10, 40),
point!(20, 25, 20),
]);