Calculate the area of geometry
조회 수: 42 (최근 30일)
이전 댓글 표시
I have a difficult problem and I need help, "Write a function to calculate the area and perimeter of shapes: triangle, rectangle, circle?"
답변 (3개)
Walter Roberson
2022년 9월 30일
The first thing you need to do is decide how the user is going to represent the specific shape for calculation purposes.
- are you going to have them input coordinates of each point?
- are you going to have them input parameters such as height and width of the square, or radius of the circle?
- are you going to have them input side lengths for the triangle? Side Angle Side ? From one side and two angles https://sciencing.com/calculate-triangle-one-side-given-8464316.html ? From three angles?
- are you going to have the user draw the shape on the screen?
Once you have made the decision about representation, we can assist you in what user interface calls to make to fetch the input.
참고 항목
카테고리
Help Center 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!