docs/examples/MultipleTimeSeries.java
/**
     * Function to create sample sine and cosine values.
     *
     * @param duration  duration
     * @param frequency frequency
     * @param stepsize  step size
     * @return generated sine and cosine values
     */
Function to create sample sine and cosine values.
@param duration  duration
@param frequency frequency
@param stepsize  step size
@return generated sine and cosine values
Function to create sample sine and cosine values . @param duration duration @param frequency frequency @param stepsize step size @return generated sine and cosine values
private static Data createSineAndCosineWave(double duration, double frequency,
                                                double stepsize) {
        int size = (int) Math.ceil(duration * 2 * Math.PI / stepsize);
        double[] sine = new double[size];
        double[] cosine = new double[size];
        for (int i = 0; i < size; i++) {
            double x = i * stepsize;
            sine[i] = Math.sin(frequency * x);
            cosine[i] = Math.cos(frequency * x);
        }
        return new Data(sine, cosine);
    }
private static Data createSineAndCosineWave ( double duration , double frequency , double stepsize ) { int size = ( int ) Math . ceil ( duration * 2 * Math . PI / stepsize ) ; double [ ] sine = new double [ size ] ; double [ ] cosine = new double [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { double x = i * stepsize ; sine [ i ] = Math . sin ( frequency * x ) ; cosine [ i ] = Math . cos ( frequency * x ) ; } return new Data ( sine , cosine ) ; }
Function to create sample sine and cosine values.
Function to create sample sine and cosine values .
// sine // cosine