drawSine (t,max) {

        const {yAxis,xAxis} = this.props;
        let unit = 60;
        // Set the initial x and y, starting at 0,0 and translating to the origin on
        // the canvas.
        var x = 0;
        var y = Math.sin(x);
        this.context.moveTo(xAxis, unit*y+yAxis);

        // Loop to draw segments
        for (let i = 0; i <= max; i += 10) {
            x = (i)/unit;
            y = Math.sin(x);
            this.context.lineTo(i, unit*y+yAxis);
            this.context.stroke();

        }
    }
/**
     * Function to draw sine
     *
     * The sine curve is drawn in 10px segments starting at the origin.
     */
Function to draw sine
The sine curve is drawn in 10px segments starting at the origin.
Function to draw sine The sine curve is drawn in 10px segments starting at the origin .
drawSine (t,max) {
        const {yAxis,xAxis} = this.props;
        let unit = 60;
        var x = 0;
        var y = Math.sin(x);
        this.context.moveTo(xAxis, unit*y+yAxis);
        for (let i = 0; i <= max; i += 10) {
            x = (i)/unit;
            y = Math.sin(x);
            this.context.lineTo(i, unit*y+yAxis);
            this.context.stroke();
        }
    }
drawSine ( t , max ) { const { yAxis , xAxis } = this . props ; let unit = 60 ; var x = 0 ; var y = Math . sin ( x ) ; this . context . moveTo ( xAxis , unit * y + yAxis ) ; for ( let i = 0 ; i <= max ; i += 10 ) { x = ( i ) / unit ; y = Math . sin ( x ) ; this . context . lineTo ( i , unit * y + yAxis ) ; this . context . stroke ( ) ; } }
Function to draw sine
 The sine curve is drawn in 10px segments starting at the origin.
Function to draw sine The sine curve is drawn in 10px segments starting at the origin .
// Set the initial x and y, starting at 0,0 and translating to the origin on // the canvas. // Loop to draw segments