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