AngouriMath
Navigation
Of(AngouriMath.Entity,System.Collections.Generic.IReadOnlyDictionary{AngouriMath.Entity.Variable,AngouriMath.Core.Dimension})
Method (no overloads)
Summary
The dimension of expr as written, or the subexpression where
it stops making physical sense.
it stops making physical sense.
Parameter "expr"
The formula, an expression or a statement.
Parameter "dimensions"
The dimension of each variable it mentions. The constants
pi and e and every number are pure numbers and need no entry.
Returns
Consistent with the dimension of the result — a
statement such as an equation is a pure number once its sides agree;
Inconsistent with the subexpression at fault and why;
or Undetermined where it could not be settled.
statement such as an equation is a pure number once its sides agree;
Inconsistent with the subexpression at fault and why;
or Undetermined where it could not be settled.
Remarks
since it is the same quantity in every unit:
inconsistent, although it simplifies to
Example
using System;
using System.Collections.Generic;
using AngouriMath;
using AngouriMath.Core;
var acceleration = Dimension.Length / Dimension.Time.Pow(2);
var dims = new Dictionary<Entity.Variable, Dimension>
{
["g"] = acceleration, ["h"] = Dimension.Length, ["t"] = Dimension.Time,
};
Console.WriteLine(MathS.Dimensions.Of("sqrt(2 g h)", dims));
Console.WriteLine(MathS.Dimensions.Of("h - g t^2 / 2 = 0", dims));
Console.WriteLine(MathS.Dimensions.Of("h + g t", dims));Prints
Consistent: L T^-1
Consistent: 1
Inconsistent at h + g * t: h has dimension L and g * t has dimension L T^-1, so they cannot be addedAngouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 6003 pages online