From 3a8655c34393db3db9fdee2de5a7ec95d1685597 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 14 Oct 2023 11:59:44 -0700 Subject: [PATCH] Display for Planar64+Planar64Mat3 --- src/integer.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/integer.rs b/src/integer.rs index c568d2a..bd43b63 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -489,6 +489,13 @@ impl TryFrom for Planar64{ } } } +impl std::fmt::Display for Planar64{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"{:.3}", + Into::::into(*self), + ) + } +} impl std::ops::Neg for Planar64{ type Output=Planar64; #[inline] @@ -832,6 +839,15 @@ impl TryFrom for Planar64Mat3{ }) } } +impl std::fmt::Display for Planar64Mat3{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"\n{:.3},{:.3},{:.3}\n{:.3},{:.3},{:.3}\n{:.3},{:.3},{:.3}", + Into::::into(self.x_axis.x()),Into::::into(self.x_axis.y()),Into::::into(self.x_axis.z()), + Into::::into(self.y_axis.x()),Into::::into(self.y_axis.y()),Into::::into(self.y_axis.z()), + Into::::into(self.z_axis.x()),Into::::into(self.z_axis.y()),Into::::into(self.z_axis.z()), + ) + } +} impl std::ops::Div for Planar64Mat3{ type Output=Planar64Mat3; #[inline]