Esempio n. 1
0
 public static PreciseDouble ConvertTo(PreciseDouble value, UnitOfMeasure from, UnitOfMeasure to)
 {
     if (from == to)
     {
         return(value);
     }
     return((value * from.ConversionFactor) / to.ConversionFactor);
 }
Esempio n. 2
0
 public static PointM FromVector(Vector vec, UnitOfMeasure unit)
 {
     return(new PointM(Measure.FromNormalizedValue(vec.X, unit), Measure.FromNormalizedValue(vec.Y, unit)));
 }
Esempio n. 3
0
 public PointM(Vector vector, UnitOfMeasure unit)
 {
     this.x = Measure.FromNormalizedValue(vector.X, unit);
     this.y = Measure.FromNormalizedValue(vector.Y, unit);
 }
Esempio n. 4
0
 public PointM(PreciseDouble x, PreciseDouble y, UnitOfMeasure unit)
 {
     this.x = new Measure(x, unit);
     this.y = new Measure(y, unit);
 }
Esempio n. 5
0
 private Measure(SerializationInfo info, StreamingContext context)
 {
     _Unit           = UnitOfMeasure.GetUnitByName(info.GetString("Unit"));
     normalizedValue = info.GetDouble("Value") * _Unit.ConversionFactor;
 }
Esempio n. 6
0
 public Measure Convert(UnitOfMeasure unitOfMeasure)
 {
     return(FromNormalizedValue(normalizedValue, unitOfMeasure));
 }