Java Minute addMinutesToMjd(double mjd, double minutes)

Here you can find the source of addMinutesToMjd(double mjd, double minutes)

Description

Add minutes to Modified Julian Date and return the result

License

Open Source License

Parameter

Parameter Description
mjd Modified Julian Date
minutes number of minutes to add

Return

result of addition ni Modified Julian Date

Declaration

public static double addMinutesToMjd(double mjd, double minutes) 

Method Source Code

//package com.java2s;
/* MOD_V2.0/*from w ww  . j  av  a  2 s .co  m*/
 * Copyright (c) 2012 OpenDA Association
 * All rights reserved.
 *
 * This file is part of OpenDA.
 *
 * OpenDA is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * OpenDA is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with OpenDA.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    private static final double mjdAtJanFirst1970 = 40587.0;
    private static final double minutesToDays = 1.0 / (60 * 24);
    private static final double daysToMinutes = 60 * 24;

    /**
     * Add minutes to Modified Julian Date and return the result
     *
     * @param mjd
     *           Modified Julian Date
     * @param minutes
     *           number of minutes to add
     * @return result of addition ni Modified Julian Date
     */
    public static double addMinutesToMjd(double mjd, double minutes) {
        double timeInMinutes = (mjd - mjdAtJanFirst1970) * daysToMinutes;
        double newTimeInMinutes = timeInMinutes + minutes;
        return newTimeInMinutes * minutesToDays + mjdAtJanFirst1970;
    }
}

Related

  1. buildDelayParamForMinutes(final int delayInMinutes)
  2. calculateRuntimeMinutes(long startTime, long endTime)
  3. calMinutes(Date date1, Date date2)
  4. countMinute(Long time)