This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Vector } from "./vector" | |
const mi = { | |
m11: 0, m12: 1, m13: 2, | |
m21: 3, m22: 4, m23: 5, | |
m31: 6, m32: 7, m33: 8, | |
} | |
export class Matrix { | |
constructor(public v: number[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp::{max, min}; | |
use std::mem::swap; | |
#[derive(Debug)] | |
pub struct Point { | |
pub x: f32, | |
pub y: f32, | |
} | |
impl Point { | |
pub fn new(x: f32, y: f32) -> Point { |