AngouriMath
Interval
Method with 2 overloads
Interval(AngouriMath.Entity,AngouriMath.Entity)
Summary
Creates a closed interval (segment)
Example
using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets; var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 > x2 > 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = @"{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = @"5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify());
Prints
{ 1, 2, 3 } \/ { 2, 3, 4 } { 1, 2, 3, 4 } ---------------------- { 1, 2, 3 } \/ [-6; 2] { 3 } \/ [-6; 2] ---------------------- { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True ---------------------- { 1, 2, 3 } /\ { 2, 3, 4 } { 2, 3 } ---------------------- { 2, 3, 4 } /\ [-6; 2] { 2 } ---------------------- [-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11] [-6; -3) ---------------------- { 1, 2, 3 } /\ { 2, 3, 4 } { 2, 3 } ---------------------- 5 in [1; +oo) \/ { x : x < -4 } True ---------------------- { pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }
Interval(AngouriMath.Entity,System.Boolean,AngouriMath.Entity,System.Boolean)
Summary
Creates an interval with custom endings
Example
using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets; var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 > x2 > 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = @"{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = @"5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify());
Prints
{ 1, 2, 3 } \/ { 2, 3, 4 } { 1, 2, 3, 4 } ---------------------- { 1, 2, 3 } \/ [-6; 2] { 3 } \/ [-6; 2] ---------------------- { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True ---------------------- { 1, 2, 3 } /\ { 2, 3, 4 } { 2, 3 } ---------------------- { 2, 3, 4 } /\ [-6; 2] { 2 } ---------------------- [-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11] [-6; -3) ---------------------- { 1, 2, 3 } /\ { 2, 3, 4 } { 2, 3 } ---------------------- 5 in [1; +oo) \/ { x : x < -4 } True ---------------------- { pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online