$.math.cos( value)

Cosine of a value

  • value : number //

Examples

import {$} from "/lib/TeachAndDraw.js";
$.use(update);
function update() {
    const newX = $.math.cos($.frameCount)*10;
    $.text.print(50,20,"newX:"+$.math.floor(newX).toFixed(1).toString());
    $.shape.line(
        0,$.h/2,
        $.w,$.h/2
    )
    $.shape.oval(
        newX, $.h/2, 10, 10
    )
}