No description
Find a file
Ivan Bushchik 5448afe653
Update deps and fix some useless code
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
2023-03-12 21:27:34 +03:00
matrix Update deps and fix some useless code 2023-03-12 21:27:34 +03:00
matrix_graphics Update deps and fix some useless code 2023-03-12 21:27:34 +03:00
.gitignore Initial commit 2023-03-11 20:26:57 +03:00
.rustfmt.toml Initial commit 2023-03-11 20:26:57 +03:00
Cargo.toml Reformat code 2023-03-12 10:02:36 +03:00
LICENSE Initial commit 2023-03-11 20:26:57 +03:00
README.md Add README.md 2023-03-12 10:14:07 +03:00

Matrix

Oh yes. Matrices.

Contents

  • matrix - core lib (just matrix addition and multiplication)
  • matrix_graphics - using rotation matrix to rotate things (polygons by default)

matrix_graphics

Run

cargo run

Configure

Edit these constants to configure code.

const WIDTH: u32 = 640;
// width of window
const HEIGHT: u32 = 480;
// height of window
const POLYGON: usize = 7;
// count of sides of generated polygon (>= 2 for math reasons) 
const CENTER_X: u32 = 320;
// center of polygon by X
const CENTER_Y: u32 = 240;
// center of polygon by Y
const RADIUS: u32 = 100;
// radius of polygon
const DEFAULT_ANGLE: f64 = 0.;
//default rotation angle (in radians)

License

All code is available under the terms of the MIT license.