| Crates.io | pythagore_tina |
| lib.rs | pythagore_tina |
| version | 0.2.0 |
| created_at | 2025-07-09 13:06:02.953837+00 |
| updated_at | 2025-07-09 14:03:28.042975+00 |
| description | Rust Library to Solve the Pythagorean Theorem |
| homepage | |
| repository | https://github.com/Tina-1300/pythagore_tina |
| max_upload_size | |
| id | 1744913 |
| size | 15,686 |
Rust Library to Solve the Pythagorean Theorem
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.");
}
}