Beispiel #1
0
        /// <summary>
        /// Returns the string representation of this object</summary>
        /// <param name="format">Optional standard numeric format string for a floating point number.
        /// If null, "R" is used for round-trip support in case the string is persisted.
        /// http://msdn.microsoft.com/en-us/library/vstudio/dwhawy9k(v=vs.100).aspx </param>
        /// <param name="formatProvider">Optional culture-specific formatting provider. This is usually
        /// a CultureInfo object or NumberFormatInfo object. If null, the current culture is used.
        /// Use CultureInfo.InvariantCulture for persistence.</param>
        /// <returns>String that represents matrix</returns>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            string listSeparator = StringUtil.GetNumberListSeparator(formatProvider);

            // For historic reasons, use "R" for round-trip support, in case this string is persisted.
            if (format == null)
            {
                format = "R";
            }

            return(String.Format(
                       "{0}{16} {1}{16} {2}{16} {3}{16} {4}{16} {5}{16} {6}{16} {7}{16} {8}{16} {9}{16} " +
                       "{10}{16} {11}{16} {12}{16} {13}{16} {14}{16} {15}",
                       M11.ToString(format, formatProvider),
                       M12.ToString(format, formatProvider),
                       M13.ToString(format, formatProvider),
                       M14.ToString(format, formatProvider),
                       M21.ToString(format, formatProvider),
                       M22.ToString(format, formatProvider),
                       M23.ToString(format, formatProvider),
                       M24.ToString(format, formatProvider),
                       M31.ToString(format, formatProvider),
                       M32.ToString(format, formatProvider),
                       M33.ToString(format, formatProvider),
                       M34.ToString(format, formatProvider),
                       M41.ToString(format, formatProvider),
                       M42.ToString(format, formatProvider),
                       M43.ToString(format, formatProvider),
                       M44.ToString(format, formatProvider),
                       listSeparator));
        }
Beispiel #2
0
 public void dump(string name = "")
 {
     DOut.pl(nameof(UMatrix4) + " " + name + " {");
     DOut.Indent++;
     DOut.pl(M11.ToString() + ", " + M12.ToString() + ", " + M13.ToString() + ", " + M14.ToString());
     DOut.pl(M21.ToString() + ", " + M22.ToString() + ", " + M23.ToString() + ", " + M24.ToString());
     DOut.pl(M31.ToString() + ", " + M32.ToString() + ", " + M33.ToString() + ", " + M34.ToString());
     DOut.pl(M41.ToString() + ", " + M42.ToString() + ", " + M43.ToString() + ", " + M44.ToString());
     DOut.Indent--;
     DOut.pl("}");
 }
Beispiel #3
0
        public string ToString(string format, IFormatProvider formatProvider)
        {
            if (format == null)
            {
                return(ToString(formatProvider));
            }

            return(string.Format(format, formatProvider,
                                 "[M11:{0} M12:{1} M13:{2}] [M21:{3} M22:{4} M23:{5}] [M31:{6} M32:{7} M33:{8}]",
                                 M11.ToString(format, formatProvider), M12.ToString(format, formatProvider),
                                 M13.ToString(format, formatProvider),
                                 M21.ToString(format, formatProvider), M22.ToString(format, formatProvider),
                                 M23.ToString(format, formatProvider),
                                 M31.ToString(format, formatProvider), M32.ToString(format, formatProvider),
                                 M33.ToString(format, formatProvider)));
        }
Beispiel #4
0
        public string ToString(string format)
        {
            if (format == null)
            {
                return(ToString());
            }

            return(string.Format(format, CultureInfo.CurrentCulture,
                                 "[M11:{0} M12:{1} M13:{2}] [M21:{3} M22:{4} M23:{5}] [M31:{6} M32:{7} M33:{8}]",
                                 M11.ToString(format, CultureInfo.CurrentCulture), M12.ToString(format, CultureInfo.CurrentCulture),
                                 M13.ToString(format, CultureInfo.CurrentCulture),
                                 M21.ToString(format, CultureInfo.CurrentCulture), M22.ToString(format, CultureInfo.CurrentCulture),
                                 M23.ToString(format, CultureInfo.CurrentCulture),
                                 M31.ToString(format, CultureInfo.CurrentCulture), M32.ToString(format, CultureInfo.CurrentCulture),
                                 M33.ToString(format, CultureInfo.CurrentCulture)));
        }
Beispiel #5
0
        public string ToString(string formatDouble, IFormatProvider provider)
        {
            StringBuilder s = new StringBuilder();

            s.Append(M11.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M12.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M13.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M21.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M22.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M23.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M31.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M32.ToString(formatDouble, provider));
            s.Append(", ");
            s.Append(M33.ToString(formatDouble, provider));

            return(s.ToString());
        }
 public override string ToString()
 {
     return(M00.ToString() + "," + M01.ToString() + "," + M02.ToString() + "," + M03.ToString() + "\r\n"
            + M10.ToString() + "," + M11.ToString() + "," + M12.ToString() + "," + M13.ToString() + "\r\n"
            + M20.ToString() + "," + M21.ToString() + "," + M22.ToString() + "," + M23.ToString() + "\r\n"
            + M30.ToString() + "," + M31.ToString() + "," + M32.ToString() + "," + M33.ToString());
 }