private static void Main() { DerivedMeasure derivedMeasure = new DerivedMeasure(); var siMeasures = new SIMeasuresList(); var d = new Dictionary<Measure, int> {{siMeasures.Kilogram, 1}}; var pound = new Measure("фунт", d); var op1 = new Operand(2, derivedMeasure.Becquerel); var op2 = new Operand(4, derivedMeasure.Volt); var force = new Vector2DOperand(new Vector2D(Math.Sqrt(2.0)*2, Math.PI/4), derivedMeasure.Newton); var path = new Vector2DOperand(new Vector2D(2, 0), siMeasures.Metre); Operand op3 = force*path; /* Measure meter = new Measure("meter", 1, new Dictionary<BasicMeasures, int> { { BasicMeasures.Metre, 1 } }); Operand op1 = new Operand(2, new Dictionary<Measure, int> { { meter, 1 } }); Operand op2 = new Operand(1, new Dictionary<Measure, int> { { meter, 1 } }); var op3 = PhysicsMath.Pow(op1,3);*/ }
public static Measure Inverse(Measure measure) { var derivedMeasure = new DerivedMeasure(); return derivedMeasure.Standardize(new Measure("unnamed", Inverse(measure.Equivalent), Inverse(measure.SIequivalent))); }
public static Measure Root(Measure measure, int pow) { var derivedMeasure = new DerivedMeasure(); return derivedMeasure.Standardize(new Measure("unnamed", Root(measure.Equivalent, pow), Root(measure.SIequivalent, pow))); }
public static Measure Divide(Measure measure1, Measure measure2) { var derivedMeasure = new DerivedMeasure(); return derivedMeasure.Standardize(Multiply(measure1, Inverse(measure2))); }
public static Measure Multiply(Measure measure1, Measure measure2) { var derivedMeasure = new DerivedMeasure(); return derivedMeasure.Standardize(new Measure("unnamed", Multiply(measure1.Equivalent, measure2.Equivalent), Multiply(measure1.SIequivalent, measure2.SIequivalent))); }