Skip to content

Saw the first few minutes of "The Goat Problem" numberphile video and thought it would be an interesting coding exercise to help me learn rust

License

Notifications You must be signed in to change notification settings

JonahBranch/goat-problem-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goat-problem-rs

Saw the first few minutes of "The Goat Problem" numberphile video and thought it would be an interesting coding exercise to help me learn rust. The goal was to find my own solution and then finish the video to see how close I got.

I failed 😅

The issue was a missing pow operation on some of the terms in the area_overlap calculation, and once I fixed it the approximation matched the video.

The solution is found using the bisection method: https://en.wikipedia.org/wiki/Bisection_method

It was fairly easy to implement and should work with other continuous fn(f64) -> f64 functions if you want to try it on something else

numberphile video: https://www.youtube.com/watch?v=ZdQFN2XKeKI

the program can be ran with just cargo run, there are no command line arguments at the moment

I'm open to contributions and critiques if you have any!

About

Saw the first few minutes of "The Goat Problem" numberphile video and thought it would be an interesting coding exercise to help me learn rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages