mathverse-geometry 0.1.3

Production-grade 2D/3D geometry library: shapes, spatial structures, transforms, intersections, distances, mesh ray tracing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Basic usage example.

use mathverse_geometry::{Circle, Point2, Triangle};

fn main() {
    let c = Circle::new(Point2::new(0.0, 0.0), 5.0);
    println!("Area: {:.2}", c.area());

    let t = Triangle::new(
        Point2::new(0.0, 0.0),
        Point2::new(4.0, 0.0),
        Point2::new(0.0, 3.0),
    );
    println!("Triangle area: {}", t.area());
}