<commit_before>// The Nature Of Code
// <NAME>
// http://natureofcode.com
//
// Example 3-01: Angular Motion(using rotate())

use nannou::prelude::*;

fn main() {
    nannou::app(model).update(update).run();
}

struct Model {
    angle: f32,
    angle_velocity: f32,
    angle_acceleration: f32,
}

fn model(app: &App) -> Model {
    let angle = 0.0;
    let angle_velocity = 0.0;
    let angle_acceleration = -0.0001;
    app.new_window().size(800, 200).view(view).build().unwrap();
    Model {
        angle,
        angle_velocity,
        angle_acceleration,
    }
}

fn update(_app: &App, model: &mut Model, _update: Update) {
    model.angle += model.angle_velocity;
    model.angle_velocity += model.angle_acceleration;
}

fn view(app: &App, model: &Model, frame: Frame) {
    // Begin drawing
    let draw = app.draw();
    draw.rect()
        .wh(app.window_rect().wh())
        .color(WHITE);

    draw.line()
        .start(pt2(-60.0, 0.0))
        .end(pt2(60.0, 0.0))
        .color(rgb8(0, 0, 0))
        .stroke_weight(2.0)
        .rotate(model.angle);

    draw.ellipse()
        .xy(pt2(60.0, 0.0)
        .rotate(model.angle))
        .w_h(16.0, 16.0)
        .gray(0.5)
        .stroke_weight(2.0)
        .stroke_color(rgb8(0, 0, 0));

    draw.ellipse()
        .xy(pt2(-60.0, 0.0)
        .rotate(model.angle))
        .w_h(16.0, 16.0)
        .gray(0.5)
        .stroke_weight(2.0)
        .stroke_color(rgb8(0, 0, 0));

    // Write the result of our drawing to the window's frame.<commit_msg>ran rustfmt<commit_after>// The Nature Of Code
// <NAME>
// http://natureofcode.com
//
// Example 3-01: Angular Motion(using rotate())

use nannou::prelude::*;

fn main() {
    nannou::app(model).update(update).run();
}

struct Model {
    angle: f32,
    angle_velocity: f32,
    angle_acceleration: f32,
}

fn model(app: &App) -> Model {
    let angle = 0.0;
    let angle_velocity = 0.0;
    let angle_acceleration = -0.0001;
    app.new_window().size(800, 200).view(view).build().unwrap();
    Model {
        angle,
        angle_velocity,
        angle_acceleration,
    }
}

fn update(_app: &App, model: &mut Model, _update: Update) {
    model.angle += model.angle_velocity;
    model.angle_velocity += model.angle_acceleration;
}

fn view(app: &App, model: &Model, frame: Frame) {
    // Begin drawing
    let draw = app.draw();
    draw.rect().wh(app.window_rect().wh()).color(WHITE);

    draw.line()
        .start(pt2(-60.0, 0.0))
        .end(pt2(60.0, 0.0))
        .color(rgb8(0, 0, 0))
        .stroke_weight(2.0)
        .rotate(model.angle);

    draw.ellipse()
        .xy(pt2(60.0, 0.0).rotate(model.angle))
        .w_h(16.0, 16.0)
        .gray(0.5)
        .stroke_weight(2.0)
        .stroke_color(rgb8(0, 0, 0));

    draw.ellipse()
        .xy(pt2(-60.0, 0.0).rotate(model.angle))
        .w_h(16.0, 16.0)
        .gray(0.5)
        .stroke_weight(2.0)
        .stroke_color(rgb8(0, 0, 0));

    // Write the result of our drawing to the window's frame.
{'fraction_non_alphanumeric': 0.1754503002001334, 'fraction_numerical': 0.05470313542361575, 'mean_word_length': 2.2316810344827585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6033815', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1135, 'n_words': 222}