Java Time Convert to timeToDriveDistanceDeadReckoning(double distance, double robotMaxSpeed, double targetSpeed)

Here you can find the source of timeToDriveDistanceDeadReckoning(double distance, double robotMaxSpeed, double targetSpeed)

Description

Return the time to drive a given distance.

License

Open Source License

Parameter

Parameter Description
distance The distance to drive.
robotMaxSpeed The max speed of the robot.
targetSpeed The max speed to drive this distance from 0 to 1 inclusive.

Return

The time to drive a given distance.

Declaration

public static double timeToDriveDistanceDeadReckoning(double distance, double robotMaxSpeed,
        double targetSpeed) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//ww  w. j  a va  2s. c  o m
     * Return the time to drive a given distance.
     *
     * @param distance      The distance to drive.
     * @param robotMaxSpeed The max speed of the robot.
     * @param targetSpeed   The max speed to drive this distance from 0 to 1 inclusive.
     * @return The time to drive a given distance.
     */
    public static double timeToDriveDistanceDeadReckoning(double distance, double robotMaxSpeed,
            double targetSpeed) {
        double distancePerSecond = robotMaxSpeed * targetSpeed;
        return distance / distancePerSecond;
    }
}

Related

  1. timeToDouble(Object value)
  2. timeToExactString(double d)
  3. timeToFloat(String aTimeDuration)
  4. timeToFromNow(long time)
  5. timeToIndex(String twentyFourHourTime)