wccerty/moonbit-artboard/src/math does not have a README file

    CubicBezier

    pub struct CubicBezier {
    p0 : Vec2
    p1 : Vec2
    p2 : Vec2
    p3 : Vec2
    } derive(Eq,
    Debug
    )

    CubicBezier::approximate_length

    fn CubicBezier::approximate_length(self : CubicBezier, samples : Int) -> Double

    CubicBezier::bounds

    fn CubicBezier::bounds(self : CubicBezier) -> Rect2D

    CubicBezier::evaluate

    fn CubicBezier::evaluate(self : CubicBezier, t : Double) -> Vec2

    CubicBezier::new

    fn CubicBezier::new(p0 : Vec2, p1 : Vec2, p2 : Vec2, p3 : Vec2) -> CubicBezier

    CubicBezier::split

    fn CubicBezier::split(self : CubicBezier, t : Double) -> (CubicBezier, CubicBezier)

    CubicBezier::tangent

    fn CubicBezier::tangent(self : CubicBezier, t : Double) -> Vec2

    Matrix2D

    pub struct Matrix2D {
    a : Double
    b : Double
    c : Double
    d : Double
    tx : Double
    ty : Double
    } derive(Eq,
    Debug
    )

    Matrix2D::approximately_equal

    fn Matrix2D::approximately_equal(self : Matrix2D, target : Matrix2D, tolerance : Double) -> Bool

    Matrix2D::around

    fn Matrix2D::around(self : Matrix2D, center : Vec2) -> Matrix2D

    Matrix2D::components

    fn Matrix2D::components(self : Matrix2D) -> TransformComponents

    Matrix2D::decompose

    fn Matrix2D::decompose(self : Matrix2D) -> MatrixDecomposition

    Matrix2D::determinant

    fn Matrix2D::determinant(self : Matrix2D) -> Double

    Matrix2D::identity

    fn Matrix2D::identity() -> Matrix2D

    Matrix2D::invert

    fn Matrix2D::invert(self : Matrix2D) -> Matrix2D?

    Matrix2D::is_identity

    fn Matrix2D::is_identity(self : Matrix2D, tolerance : Double) -> Bool

    Matrix2D::lerp

    fn Matrix2D::lerp(self : Matrix2D, target : Matrix2D, amount : Double) -> Matrix2D

    Matrix2D::maximum_scale

    fn Matrix2D::maximum_scale(self : Matrix2D) -> Double

    Matrix2D::minimum_scale

    fn Matrix2D::minimum_scale(self : Matrix2D) -> Double

    Matrix2D::multiply

    fn Matrix2D::multiply(self : Matrix2D, other : Matrix2D) -> Matrix2D

    Matrix2D::new

    fn Matrix2D::new(a : Double, b : Double, c : Double, d : Double, tx : Double, ty : Double) -> Matrix2D

    Matrix2D::reflection_x

    fn Matrix2D::reflection_x() -> Matrix2D

    Matrix2D::reflection_y

    fn Matrix2D::reflection_y() -> Matrix2D

    Matrix2D::rotation

    fn Matrix2D::rotation(angle_radians : Double) -> Matrix2D

    Matrix2D::rotation_at

    fn Matrix2D::rotation_at(angle_radians : Double, center : Vec2) -> Matrix2D

    Matrix2D::scaling

    fn Matrix2D::scaling(sx : Double, sy : Double) -> Matrix2D

    Matrix2D::scaling_at

    fn Matrix2D::scaling_at(sx : Double, sy : Double, center : Vec2) -> Matrix2D

    Matrix2D::shearing

    fn Matrix2D::shearing(kx : Double, ky : Double) -> Matrix2D

    Matrix2D::transform_bounds

    fn Matrix2D::transform_bounds(self : Matrix2D, rect : Rect2D) -> Rect2D

    Matrix2D::transform_point

    fn Matrix2D::transform_point(self : Matrix2D, p : Vec2) -> Vec2

    Matrix2D::transform_points

    fn Matrix2D::transform_points(self : Matrix2D, points : Array[Vec2]) -> Array[Vec2]

    Matrix2D::transform_vector

    fn Matrix2D::transform_vector(self : Matrix2D, v : Vec2) -> Vec2

    Matrix2D::translation

    fn Matrix2D::translation(x : Double, y : Double) -> Matrix2D

    Matrix2D::uniform_scale

    fn Matrix2D::uniform_scale(self : Matrix2D) -> Double

    Matrix2D::with_translation

    fn Matrix2D::with_translation(self : Matrix2D, translation : Vec2) -> Matrix2D

    Matrix4x4

    pub(all) struct Matrix4x4 {
    m00 : Double
    m01 : Double
    m02 : Double
    m03 : Double
    m10 : Double
    m11 : Double
    m12 : Double
    m13 : Double
    m20 : Double
    m21 : Double
    m22 : Double
    m23 : Double
    m30 : Double
    m31 : Double
    m32 : Double
    m33 : Double
    } derive(Eq,
    Debug
    )

    Matrix4x4::identity

    fn Matrix4x4::identity() -> Matrix4x4

    Matrix4x4::multiply

    fn Matrix4x4::multiply(self : Matrix4x4, other : Matrix4x4) -> Matrix4x4

    Matrix4x4::rotation_x

    fn Matrix4x4::rotation_x(angle_rad : Double) -> Matrix4x4

    Matrix4x4::rotation_y

    fn Matrix4x4::rotation_y(angle_rad : Double) -> Matrix4x4

    Matrix4x4::rotation_z

    fn Matrix4x4::rotation_z(angle_rad : Double) -> Matrix4x4

    Matrix4x4::scaling

    fn Matrix4x4::scaling(sx : Double, sy : Double, sz : Double) -> Matrix4x4

    Matrix4x4::translation

    fn Matrix4x4::translation(x : Double, y : Double, z : Double) -> Matrix4x4

    MatrixDecomposition

    pub struct MatrixDecomposition {
    translation : Vec2
    scale : Vec2
    rotation : Double
    skew : Vec2
    } derive(Eq,
    Debug
    )

    QuadraticBezier

    pub struct QuadraticBezier {
    p0 : Vec2
    p1 : Vec2
    p2 : Vec2
    } derive(Eq,
    Debug
    )

    QuadraticBezier::evaluate

    fn QuadraticBezier::evaluate(self : QuadraticBezier, t : Double) -> Vec2

    QuadraticBezier::new

    fn QuadraticBezier::new(p0 : Vec2, p1 : Vec2, p2 : Vec2) -> QuadraticBezier

    QuadraticBezier::to_cubic

    Rect2D

    pub struct Rect2D {
    min_x : Double
    min_y : Double
    max_x : Double
    max_y : Double
    } derive(Eq,
    Debug
    )

    impl Show for Rect2D

    Rect2D::center

    fn Rect2D::center(self : Rect2D) -> Vec2

    Rect2D::contains_point

    fn Rect2D::contains_point(self : Rect2D, p : Vec2) -> Bool

    Rect2D::contains_rect

    fn Rect2D::contains_rect(self : Rect2D, other : Rect2D) -> Bool

    Rect2D::corners

    fn Rect2D::corners(self : Rect2D) -> Array[Vec2]

    Rect2D::empty

    fn Rect2D::empty() -> Rect2D

    Rect2D::expand

    fn Rect2D::expand(self : Rect2D, amount : Double) -> Rect2D

    Rect2D::from_point

    fn Rect2D::from_point(p : Vec2) -> Rect2D

    Rect2D::from_points

    fn Rect2D::from_points(points : Array[Vec2]) -> Rect2D

    Rect2D::height

    fn Rect2D::height(self : Rect2D) -> Double

    Rect2D::intersection

    fn Rect2D::intersection(self : Rect2D, other : Rect2D) -> Rect2D

    Rect2D::intersects

    fn Rect2D::intersects(self : Rect2D, other : Rect2D) -> Bool

    Rect2D::is_empty

    fn Rect2D::is_empty(self : Rect2D) -> Bool

    Rect2D::new

    fn Rect2D::new(min_x : Double, min_y : Double, max_x : Double, max_y : Double) -> Rect2D

    Rect2D::union

    fn Rect2D::union(self : Rect2D, other : Rect2D) -> Rect2D

    Rect2D::width

    fn Rect2D::width(self : Rect2D) -> Double

    SegmentProjection

    pub(all) struct SegmentProjection {
    point : Vec2
    parameter : Double
    distance_squared : Double
    } derive(Eq,
    Debug
    )

    TransformComponents

    pub(all) struct TransformComponents {
    translation : Vec2
    scale : Vec2
    rotation : Double
    skew : Vec2
    } derive(Eq,
    Debug
    )

    TransformComponents::identity

    TransformComponents::lerp

    TransformComponents::new

    fn TransformComponents::new(translation : Vec2, scale : Vec2, rotation : Double, skew : Vec2) -> TransformComponents

    TransformComponents::to_matrix

    Triangle2D

    pub(all) struct Triangle2D {
    p0 : Vec2
    p1 : Vec2
    p2 : Vec2
    } derive(Eq,
    Debug
    )

    Vec2

    pub struct Vec2 {
    x : Double
    y : Double
    } derive(Eq,
    Debug
    )

    impl Show for Vec2

    Vec2::add

    fn Vec2::add(self : Vec2, other : Vec2) -> Vec2

    Vec2::angle

    fn Vec2::angle(self : Vec2) -> Double

    Vec2::angle_between

    fn Vec2::angle_between(self : Vec2, other : Vec2) -> Double

    Vec2::cross

    fn Vec2::cross(self : Vec2, other : Vec2) -> Double

    Vec2::distance

    fn Vec2::distance(self : Vec2, other : Vec2) -> Double

    Vec2::distance_sq

    fn Vec2::distance_sq(self : Vec2, other : Vec2) -> Double

    Vec2::dot

    fn Vec2::dot(self : Vec2, other : Vec2) -> Double

    Vec2::length

    fn Vec2::length(self : Vec2) -> Double

    Vec2::length_sq

    fn Vec2::length_sq(self : Vec2) -> Double

    Vec2::lerp

    fn Vec2::lerp(self : Vec2, target : Vec2, t : Double) -> Vec2

    Vec2::max

    fn Vec2::max(self : Vec2, other : Vec2) -> Vec2

    Vec2::min

    fn Vec2::min(self : Vec2, other : Vec2) -> Vec2

    Vec2::negate

    fn Vec2::negate(self : Vec2) -> Vec2

    Vec2::new

    fn Vec2::new(x : Double, y : Double) -> Vec2

    Vec2::normalize

    fn Vec2::normalize(self : Vec2) -> Vec2

    Vec2::perpendicular

    fn Vec2::perpendicular(self : Vec2) -> Vec2

    Vec2::reflect

    fn Vec2::reflect(self : Vec2, normal : Vec2) -> Vec2

    Vec2::rotate

    fn Vec2::rotate(self : Vec2, angle_radians : Double) -> Vec2

    Vec2::scale

    fn Vec2::scale(self : Vec2, scalar : Double) -> Vec2

    Vec2::sub

    fn Vec2::sub(self : Vec2, other : Vec2) -> Vec2

    Vec2::unit_x

    fn Vec2::unit_x() -> Vec2

    Vec2::unit_y

    fn Vec2::unit_y() -> Vec2

    Vec2::zero

    fn Vec2::zero() -> Vec2

    clamp_double

    fn clamp_double(value : Double, minimum : Double, maximum : Double) -> Double

    distance_squared_to_segment

    fn distance_squared_to_segment(point : Vec2, start : Vec2, end : Vec2) -> Double

    evaluate_b_spline

    fn evaluate_b_spline(p0 : Vec2, p1 : Vec2, p2 : Vec2, p3 : Vec2, t : Double) -> Vec2

    evaluate_catmull_rom

    fn evaluate_catmull_rom(p0 : Vec2, p1 : Vec2, p2 : Vec2, p3 : Vec2, t : Double) -> Vec2

    flatten_cubic

    fn flatten_cubic(curve : CubicBezier, tolerance : Double, max_depth : Int) -> Array[Vec2]

    flatten_quadratic

    fn flatten_quadratic(curve : QuadraticBezier, tolerance : Double, max_depth : Int) -> Array[Vec2]

    interpolate_catmull_rom_spline

    fn interpolate_catmull_rom_spline(points : Array[Vec2], segments_per_span : Int) -> Array[Vec2]

    interpolate_transform

    fn interpolate_transform(start : Matrix2D, target : Matrix2D, amount : Double) -> Matrix2D

    nearly_equal

    fn nearly_equal(left : Double, right : Double, tolerance : Double) -> Bool

    project_point_to_segment

    fn project_point_to_segment(point : Vec2, start : Vec2, end : Vec2) -> SegmentProjection

    signed_area

    fn signed_area(points : Array[Vec2]) -> Double

    triangulate_polygon

    fn triangulate_polygon(vertices : Array[Vec2]) -> Array[Triangle2D]