예제 #1
0
 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);
 }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }
예제 #5
0
        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;
        }
예제 #6
0
        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;
        }
예제 #7
0
        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;
        }
예제 #8
0
 public static Speed operator -(Speed v1, Speed v2)
 {
     Speed v3 = new Speed(0);
     v3.value = v1.value - v2.value;
     return v3;
 }