Пример #1
0
 /// <summary>Returns a string representation of the @this.</summary>
 /// <param name="format"></param>
 /// <param name="formatProvider"></param>
 /// <returns></returns>
 public string ToString(string format, IFormatProvider formatProvider)
 {
     return(string.Format(CultureInfo.CurrentCulture, "(({0},{1}), ({2},{3}), ({4},{5}), {6})",
                          M11.ToString(format, formatProvider), M12.ToString(format, formatProvider),
                          M21.ToString(format, formatProvider), M22.ToString(format, formatProvider),
                          M31.ToString(format, formatProvider), M32.ToString(format, formatProvider), M33.ToString(format, formatProvider)));
 }
Пример #2
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));
        }
Пример #3
0
 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());
 }
Пример #4
0
        public override string ToString()
        {
            string str = "|" + M11.ToString() + ", " + M12.ToString() + ", " + DX.ToString() + "|" + Environment.NewLine +
                         "|" + M21.ToString() + ", " + M22.ToString() + ", " + DY.ToString() + "|" + Environment.NewLine +
                         "|0, 0, 1|";

            return(str);
        }
Пример #5
0
 public string ToString(IFormatProvider formatProvider)
 {
     return(string.Format(formatProvider,
                          "[M11:{0} M12:{1} M13:{2}] [M21:{3} M22:{4} M23:{5}] [M31:{6} M32:{7} M33:{8}]",
                          M11.ToString(formatProvider), M12.ToString(formatProvider), M13.ToString(formatProvider),
                          M21.ToString(formatProvider), M22.ToString(formatProvider), M23.ToString(formatProvider),
                          M31.ToString(formatProvider), M32.ToString(formatProvider), M33.ToString(formatProvider)));
 }
Пример #6
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("}");
 }
Пример #7
0
        /// <summary>
        /// Returns a String representing this matrix instance.
        /// </summary>
        /// <returns>The string representation.</returns>
        public override string ToString()
        {
            var ci = System.Globalization.CultureInfo.CurrentCulture;

            return(string.Format(
                       ci,
                       "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} }}",
                       M11.ToString(ci),
                       M12.ToString(ci),
                       M21.ToString(ci),
                       M22.ToString(ci),
                       M31.ToString(ci),
                       M32.ToString(ci)));
        }
Пример #8
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)));
        }
Пример #9
0
 public override string ToString()
 {
     if (IsIdentity)
     {
         return(this.GetType().Name + "=Identity");
     }
     else
     {
         return(string.Format(this.GetType().Name + "{{M11={0} M12={1} M21={2} M22={3} OffsetX={4} OffsetY={5}}}",
                              M11.ToString(CultureInfo.InvariantCulture),
                              M12.ToString(CultureInfo.InvariantCulture),
                              M21.ToString(CultureInfo.InvariantCulture),
                              M22.ToString(CultureInfo.InvariantCulture),
                              OffsetX.ToString(CultureInfo.InvariantCulture),
                              OffsetY.ToString(CultureInfo.InvariantCulture)));
     }
 }
Пример #10
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());
        }