<commit_before>/**
 * @author  Hyperandroid  ||  http://hyperandroid.com/
 *
 * Scene 11.
 * Shows some accelerometer based demo.
 *
 */

function __scene11(director) {

    var i;
    var scene= new CAAT.Scene();
    scene.create();

    __scene11_text(director,scene);

    var text= new CAAT.TextActor().
            setFont("100px sans-serif").
            setText("Rotate Device").
            create().
            setFillStyle('red').
            setOutline(true).
            calcTextSize(director);
    text.setLocation((director.canvas.width-text.width)/2,
            (director.canvas.height-text.height)/2);
	scene.addChild(text);

    scene.endAnimate= function(director, time) {
        var rx= window.innerWidth/window.innerHeight > 1 ? CAAT.accelerationIncludingGravity.y : CAAT.accelerationIncludingGravity.x;

        var signo= rx<0 ? 1 : -1;
        rx/=10; // 9.8 m/s^2

        text.setRotation( -rx*Math.PI/3.3 );
    };
<commit_msg>Added accelerometer and angles information.<commit_after>/**
 * @author  Hyperandroid  ||  http://hyperandroid.com/
 *
 * Scene 11.
 * Shows some accelerometer based demo.
 *
 */

function __scene11(director) {

    var i;
    var scene= new CAAT.Scene();
    scene.create();

    __scene11_text(director,scene);

    var text= new CAAT.TextActor().
            setFont("100px sans-serif").
            setText("Rotate Device").
            create().
            setFillStyle('red').
            setOutline(true).
            calcTextSize(director);
    text.setLocation((director.canvas.width-text.width)/2,
            (director.canvas.height-text.height)/2);
	scene.addChild(text);

    var tx= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Acceleration X:").
            create().
            setLocation(10,20);
    var ty= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Acceleration Y:").
            create().
            setLocation(10,40);
    var tz= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Acceleration Z:").
            create().
            setLocation(10,60);
    var alpha= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Alpha: ").
            create().
            setLocation(10,80);
    var beta= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Beta: ").
            create().
            setLocation(10,100);
    var gamma= new CAAT.TextActor().
            setFont("15px sans-serif").
            setText("Gamma: ").
            create().
            setLocation(10,120);
    scene.addChild(tx);
    scene.addChild(ty);
    scene.addChild(tz);
    scene.addChild(alpha);
    scene.addChild(beta);
    scene.addChild(gamma);


    scene.endAnimate= function(director, time) {
        var rx= window.innerWidth/window.innerHeight > 1 ? CAAT.accelerationIncludingGravity.y : CAAT.accelerationIncludingGravity.x;

        var signo= rx<0 ? 1 : -1;
        rx/=10; // 9.8 m/s^2

        text.setRotation( -rx*Math.PI/3.3 );

        tx.setText('Acceleration X: '+CAAT.accelerationIncludingGravity.x);
        ty.setText('Acceleration Y: '+CAAT.accelerationIncludingGravity.y);
        tz.setText('Acceleration Z: '+CAAT.accelerationIncludingGravity.z);

        alpha.setText('Alpha: '+CAAT.rotationRate.alpha);
        beta.setText( 'Beta:  '+CAAT.rotationRate.beta);
        gamma.setText('Gamma: '+CAAT.rotationRate.gamma);
    };


{'fraction_non_alphanumeric': 0.14342971657600917, 'fraction_numerical': 0.023475522473518466, 'mean_word_length': 2.1477477477477476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1844235', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1054, 'n_words': 193}