Write a program that draw ta pentagram of user-specified size, like the one show
ID: 3695523 • Letter: W
Question
Write a program that draw ta pentagram of user-specified size, like the one shown in the example plot above. Specifications: The pentagram is of user-specified size. Note the five tips of the pentagram are located in a circle? Your program will prompt the user for the radius of that circle; your program should validate for positive numbers. Use geometry/trigonometry to calculate the x vector and y vector of the tips that are necessary to plot he pentagram. Do not use loops. Instead, use arrays and array math. Be creative with your plot, as long as it shows the lines, the tips, and the text with radius.Explanation / Answer
Drawing a pentagram requires a circle and a long horizontal line.This line is extended to other 4 lines to form inner star structure.
[x, y] = circle(0, 0, 5, 5); % coordinates of the points on external radius
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.