/** * Returns a new {@code Measurement} object that is the subtraction of the * specified value from this object. * * @param d The value that will be subtracted from this object. * @return A new {@code Measurement} object that is the subtraction of the * specified value from this object. The error, unit and time of the * new object is set to the error, {@code Unit} object and time of * this object. */ public Measurement sub(double d) { return new Measurement(value - d, error, unit, time); }
/** * Returns a new {@code Measurement} object that is the sum of this object * added to the specified value. * * @param d The value that will be added with this object. * @return A new {@code Measurement} object that is the sum of this object * added to the specified value. The error, unit, and time of the * new object is set to the error, {@code Unit} and time of this * object. */ public Measurement add(double d) { return new Measurement(value + d, error, unit, time); }
/** * Returns a new {@code Measurement} object that is the quotient of this * object divided by the specified value. * * @param d The value that will be the divisor of this object. * @return A new {@code Measurement} object that is the quotient of this * object divided by the specified value. The error of the new * object is computed. The unit and time of the new object is set to * the {@code Unit} and time of this object. */ public Measurement div(double d) { return new Measurement(value / d, error / Math.abs(d), unit, time); }
/** * Returns a new {@code Measurement} object that is the product of this * object multiplied by the specified value. * * @param d The value that will be multiplied with this object. * @return A new {@code Measurement} object that is the product of this * object multiplied by the specified value. The error of the new * object is computed. The unit and time of the new object is set to * the unit and time of this object. */ public Measurement mul(double d) { return new Measurement(value * d, error * Math.abs(d), unit, time); }
/** * Returns a new {@code Measurement} object that is the sum of this object * added to the specified value. * * @param d The value that will be added with this object. * @param u The {@code Unit} object of the specified value. * @return A new {@code Measurement} object that is the sum of this object * added to the specified value. The unit of the new object is * computed. The error and time of the new object is set to the * error and time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified value cannot be added. * @see Unit */ public Measurement add(double d, Unit u) { return new Measurement(value + d, error, unit.add(u), time); }
/** * Returns a new {@code Measurement} object that is the sum of this object * added to the specified object. * * The error and unit of the new object are computed. The time of the new * object is set to the time of this object. * * @param m The {@code Measurement} object that will be added with this * object. * @return A new {@code Measurement} object that is the sum of this and m. * @see Unit * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be added. */ public Measurement add(Measurement m) { return new Measurement(value + m.value, error + m.error, unit.add(m.unit), time); }
/** * Returns a new {@code Measurement} object that is the product of this * object multiplied by the specified value. * * @param d The value that will be multiplied with this object. * @param u The {@code Unit} of the specified value. * @return A new {@code Measurement} object that is the product of this * object multiplied by the specified value. The error and unit of * the new object are computed. The time of the new object is set to * the time of this object. * @throws ArithmeticException If the units of this object and the specified * value cannot be multiplied. * @see Unit */ public Measurement mul(double d, Unit u) { return new Measurement(value * d, error * Math.abs(d), unit.mul(u), time); }
/** * Returns a new {@code Measurement} object that is the subtraction of the * specified value from this object. * * @param d The value that will be subtracted from this object. * @param u The {@code Unit} object of the specified value. * @return A new {@code Measurement} object that is the subtraction of the * specified value from this object. The unit of the new object is * computed. The error and time of the new object is set to the * error and time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be subtracted. * @see Unit */ public Measurement sub(double d, Unit u) { return new Measurement(value - d, error, unit.sub(u), time); }
/** * Returns a new {@code Measurement} object that is the quotient of this * object divided by the specified value. * * @param d The value that will be the divisor of this object. * @param u The {@code Unit} object of the specified value. * @return A new {@code Measurement} that is the quotient of this object * divided by the specified value. The error and unit of the new * object are computed. The time of the new object is set to the * time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be divided. * @see Unit */ public Measurement div(double d, Unit u) { return new Measurement(value / d, error / Math.abs(d), unit.div(u), time); }
/** * Returns a new {@code Measurement} object that is the subtraction of the * specified object from this object. * * @param m The {@code Measurement} object that will be subtracted from this * object. * @return A new {@code Measurement} object that is the subtraction of the * specified object from this object. The error and unit of the new * object are computed. The time of the new object is set to the * time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be subtracted. * @see Unit */ public Measurement sub(Measurement m) { return new Measurement(value - m.value, error + m.error, unit.sub(m.unit), time); }
/** * Returns a new {@code Measurement} object that is the product of this * object multiplied by the specified object. * * @param m The {@code Measurement} object that will be multiplied with this * object. * @return A new {@code Measurement} that is the product of this object * multiplied by the specified object. The error and unit of the new * object are computed. The time of the new object is set to the * time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be multiplied. * @see Unit */ public Measurement mul(Measurement m) { double mvalue = m.value; return new Measurement(value * mvalue, Math.abs(value) * m.error + error * Math.abs(mvalue), unit.mul(m.unit), time); }
/** * Returns a new {@code Measurement} object that is the quotient of this * object divided by the specified object. * * @param m The {@code Measurement} object that will be the divisor of this * object. * @return A new {@code Measurement} object that is the quotient of this * object divided by the specified object. The error and unit of the * new object are computed. The time of the new object is set to the * time of this object. * @throws ArithmeticException If the {@code Unit} objects of this object * and the specified object cannot be divided. * @see Unit */ public Measurement div(Measurement m) { double mvalue = m.value; return new Measurement(value / mvalue, (Math.abs(value) * m.error + error * Math.abs(mvalue)) / (mvalue * mvalue), unit.div(m.unit), time); }
dlat = normalize((LAT_RANGE * 2.0D) - dlat, LAT_RANGE); lon = new Measurement(dlon, lon.getError(), lon.getUnit(), lon.getTime()); lat = new Measurement(dlat, lat.getError(), lat.getUnit(), lat.getTime()); dtrack += TRACK_RANGE; track = new Measurement(dtrack, track.getError(), track.getUnit(), track.getTime());
/** * Returns a new <code>Measurement</code> object that is the subtraction of * the specified value from this object. * * @param d The value that will be subtracted from this object. * @return A new <code>Measurement</code> object that is the subtraction of * the specified value from this object. The error, unit and time of * the new object is set to the error, <code>Unit</code> object and * time of this object. */ public Measurement sub(double d) { return new Measurement(value - d, error, unit, time); }
/** * Returns a new <code>Measurement</code> object that is the sum of this * object added to the specified value. * * @param d The value that will be added with this object. * @return A new <code>Measurement</code> object that is the sum of this * object added to the specified value. The error, unit, and time of * the new object is set to the error, <code>Unit</code> and time of * this object. */ public Measurement add(double d) { return new Measurement(value + d, error, unit, time); }
/** * Returns a new <code>Measurement</code> object that is the product of this * object multiplied by the specified value. * * @param d The value that will be multiplied with this object. * @return A new <code>Measurement</code> object that is the product of this * object multiplied by the specified value. The error of the new * object is computed. The unit and time of the new object is set to * the unit and time of this object. */ public Measurement mul(double d) { return new Measurement(value * d, error * Math.abs(d), unit, time); }
/** * Returns a new <code>Measurement</code> object that is the quotient of this * object divided by the specified value. * * @param d The value that will be the divisor of this object. * @return A new <code>Measurement</code> object that is the quotient of this * object divided by the specified value. The error of the new * object is computed. The unit and time of the new object is set to * the <code>Unit</code> and time of this object. */ public Measurement div(double d) { return new Measurement(value / d, error / Math.abs(d), unit, time); }
/** * Returns a new <code>Measurement</code> object that is the subtraction of * the specified value from this object. * * @param d The value that will be subtracted from this object. * @param u The <code>Unit</code> object of the specified value. * @return A new <code>Measurement</code> object that is the subtraction of * the specified value from this object. The unit of the new object * is computed. The error and time of the new object is set to the * error and time of this object. * @throws ArithmeticException If the <code>Unit</code> objects of this object * and the specified object cannot be subtracted. * @see Unit */ public Measurement sub(double d, Unit u) { return new Measurement(value - d, error, unit.sub(u), time); }
/** * Returns a new <code>Measurement</code> object that is the subtraction of * the specified object from this object. * * @param m The <code>Measurement</code> object that will be subtracted from * this object. * @return A new <code>Measurement</code> object that is the subtraction of * the specified object from this object. The error and unit of the * new object are computed. The time of the new object is set to the * time of this object. * @throws ArithmeticException If the <code>Unit</code> objects of this object * and the specified object cannot be subtracted. * @see Unit */ public Measurement sub(Measurement m) { return new Measurement(value - m.value, error + m.error, unit .sub(m.unit), time); }
/** * Returns a new <code>Measurement</code> object that is the sum of this * object added to the specified value. * * @param d The value that will be added with this object. * @param u The <code>Unit</code> object of the specified value. * @return A new <code>Measurement</code> object that is the sum of this * object added to the specified value. The unit of the new object * is computed. The error and time of the new object is set to the * error and time of this object. * @throws ArithmeticException If the <code>Unit</code> objects of this object * and the specified value cannot be added. * @see Unit */ public Measurement add(double d, Unit u) { return new Measurement(value + d, error, unit.add(u), time); }