pythagore_tina

Crates.iopythagore_tina
lib.rspythagore_tina
version0.2.0
created_at2025-07-09 13:06:02.953837+00
updated_at2025-07-09 14:03:28.042975+00
descriptionRust Library to Solve the Pythagorean Theorem
homepage
repositoryhttps://github.com/Tina-1300/pythagore_tina
max_upload_size
id1744913
size15,686
Tina (Tina-1300)

documentation

README

pythagore_tina

Rust Library to Solve the Pythagorean Theorem

Use

use pythagore_tina::Pythagore;

fn main(){

    // Check if it is a right triangle
    let is_right = Pythagore::is_rectangle(5.0, 3.0, 4.0);
    println!("Is it a right triangle ? {}", is_right); // true

    // Calculate the hypotenuse
    let hyp = Pythagore::hypotenuse(3.0, 4.0);
    println!("Hypotenuse : {}", hyp); // 5.0

    // Calculate another side if hypotenuse known
    let side = Pythagore::other_side(3.0, 5.0);
    if !side.is_nan(){
        println!("Other side : {}", side); // 4.0
    }else {
        println!("Invalid side or hypotenuse given.");
    }
    
}
Commit count: 0

cargo fmt