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