Exemple #1
0
        public static LineByEquation CreateLineByEquation(Drawing drawing, string a, string b, string c)
        {
            var result = new LineByEquation()
            {
                Drawing = drawing
            };
            var equation = new GeneralFormLineEquation(result, a, b, c);

            result.Equation = equation;
            equation.Recalculate();
            return(result);
        }
        public static ILineEquation Read(LineByEquation parent, XElement element)
        {
            var m = element.ReadString("m");
            var b = element.ReadString("b");
            var A = element.ReadString("A");
            var B = element.ReadString("B");
            var C = element.ReadString("C");

            ILineEquation result = null;

            if (!m.IsEmpty() && !b.IsEmpty())
            {
                result = new SlopeInterseptLineEquation(parent, m, b);
            }
            else if (!A.IsEmpty() && !B.IsEmpty() && !C.IsEmpty())
            {
                result = new GeneralFormLineEquation(parent, A, B, C);
            }

            return(result);
        }
Exemple #3
0
 public static LineByEquation CreateLineByEquation(Drawing drawing, string a, string b, string c)
 {
     var result = new LineByEquation() { Drawing = drawing };
     var equation = new GeneralFormLineEquation(result, a, b, c);
     result.Equation = equation;
     equation.Recalculate();
     return result;
 }
Exemple #4
0
        public static ILineEquation Read(LineByEquation parent, XElement element)
        {
            var m = element.ReadString("m");
            var b = element.ReadString("b");
            var A = element.ReadString("A");
            var B = element.ReadString("B");
            var C = element.ReadString("C");

            ILineEquation result = null;

            if (!m.IsEmpty() && !b.IsEmpty())
            {
                result = new SlopeInterseptLineEquation(parent, m, b);
            }
            else if (!A.IsEmpty() && !B.IsEmpty() && !C.IsEmpty())
            {
                result = new GeneralFormLineEquation(parent, A, B, C);
            }

            return result;
        }