Cody

Problem 45178. An n-sided regular polygon is drawn within a circle whose radius is 'r', what will be the area of the polygon?

Solution 1996165

Submitted on 30 Oct 2019 by Gergely Patay
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
n= 6; r=6; y_correct = 0.5*r^2*n*sind(360/n); assert(isequal( poly(n,r) , y_correct));

2   Pass
n= 8; r=6; y_correct = 0.5*r^2*n*sind(360/n); assert(isequal( poly(n,r) , y_correct));

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!