public static Speed operator *(Time t, Acceleration a) { Speed v = new Speed(0); v.distanceType = a.distanceType; Converter converter = new Converter(); v.value = converter.ConvertToSI(a).value * converter.ConvertToSI(t).value; return converter.ConvertFromSI(v); }
public string GiveValueInSI() { Speed x = new Speed(value); x.distanceType = distanceType; x.timeType = timeType; Converter conv = new Converter(); string message = conv.ConvertToSI(x).value + " m/s"; return message; }
public static Speed operator /(Distance s, Time t) { Speed v = new Speed(0); v.distanceType = s.distanceType; v.timeType = t.timeType; Converter converter = new Converter(); v.value = converter.ConvertToSI(s).value / converter.ConvertToSI(t).value; return converter.ConvertFromSI(v); }
public Acceleration ConvertFromSI(Acceleration x) { Acceleration newValue = new Acceleration(0); newValue.distanceType = x.distanceType; newValue.timeType = x.timeType; Speed v = new Speed(x.value); v = ConvertFromSI(v); Time t = new Time(1); t.timeType = x.timeType; t = ConvertFromSI(t); newValue.value = v.value / t.value; return newValue; }
public Speed ConvertFromSI(Speed x) { Speed newValue = new Speed(0); newValue.distanceType = x.distanceType; newValue.timeType = x.timeType; Distance s = new Distance(x.value); s.distanceType = x.distanceType; s = ConvertFromSI(s); Time t = new Time(1); t.timeType = x.timeType; t = ConvertFromSI(t); newValue.value = s.value / t.value; return newValue; }
public Acceleration ConvertToSI(Acceleration x) { Acceleration newValue = new Acceleration(0); newValue.distanceType = "m"; newValue.timeType = "s"; Speed v=new Speed(x.value); v=ConvertToSI(v); Time t = new Time(1); t.timeType = x.timeType; newValue.value = v.value / ConvertTimeToSI(t); return newValue; }
public Speed ConvertToSI(Speed x) { Speed newValue = new Speed(0); newValue.distanceType = "m"; newValue.timeType = "s"; Distance s = new Distance(x.value); newValue.value = ConvertDistanceToSI(s); Time t = new Time(1); t.timeType = x.timeType; newValue.value = newValue.value / ConvertTimeToSI(t); return newValue; }
public static Speed operator -(Speed v1, Speed v2) { Speed v3 = new Speed(0); v3.value = v1.value - v2.value; return v3; }