Problem 42721. Fun with a compass
Each night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.
After waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.
Note - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers35
Suggested Problems
-
Find the sum of all the numbers of the input vector
46971 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5549 Solvers
-
1172 Solvers
-
Write a function man that takes a row vector v and returns a matrix H as follows..
602 Solvers
-
1429 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!