필터 지우기
필터 지우기

Need help for to create a polygon drawer in a figure window

조회 수: 2 (최근 30일)
Jacob Kiem
Jacob Kiem 2018년 5월 26일
댓글: Jacob Kiem 2018년 5월 27일
Hey, So i have to create a polygon drawer in a figure window but i have no idea on how to do it. These are some of the requirements:
  • Must use plots
  • The program needs to read the position of the mouse cursor every time the user clicks onthe plot
  • The program needs to draw a line between the previous and current locations of the mousecursor after each click (assuming that the first line is drawn from 0,0 to the position of themouse in first click.
  • The program displays a corresponding polygon in a window
  • The program must allow the user to draw lines until (s)he clicks somewhere close to theorigin with the discrepancy of (0±0.1, 0±0.1)
  • After clicking near the origin, your program should calculate the perimeter of the polygonand display it either in the figure or command window.
  • The number of clicks registered by your problem should be displace as well.
please try and use comments so i can understand parts of the code. Thanks
  댓글 수: 7
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 5월 27일
Are you looking this type of output?
Jacob Kiem
Jacob Kiem 2018년 5월 27일
yes like that then for the script to calculate the perimeter of it

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by