rive_rs/math/mod.rs
1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5mod aabb;
6mod bezier;
7mod color;
8mod mat;
9mod vec;
10
11pub use aabb::Aabb;
12pub use bezier::Bezier;
13pub use color::Color;
14pub use mat::Mat;
15pub use vec::Vec;
16
17pub const CIRCLE_CONSTANT: f32 = 0.552_284_8;
18
19pub fn lerp(a: f32, b: f32, ratio: f32) -> f32 {
20 a + (b - a) * ratio
21}
22
23pub fn arc_constant(angle: f32) -> f32 {
24 4.0 / 3.0 * (angle / 4.0).tan()
25}