MATLAB Answers

create a similar but bigger polygon

1 view (last 30 days)
MatG
MatG on 23 Oct 2018
Answered: Steven Lord on 23 Oct 2018
If I have a polygon say the triangle A=(1,0), B= (2,1),C = (3,0)}formed from x=[1 2 3], y=[0 1 0] using respectively the first, second and third elements of x and y vectors, how can I create a similar polygon triangle at a fixed distance from the points on the triangle?

  0 Comments

Sign in to comment.

Answers (2)

Matt J
Matt J on 23 Oct 2018
Edited: Matt J on 23 Oct 2018
For example,
triangle=polyshape(x,y);
[cx,cy]=centroid(triangle);
biggertriangle=scale(triangle,2, [cx,cy])

  0 Comments

Sign in to comment.


Steven Lord
Steven Lord on 23 Oct 2018
If you're using release R2017b or later, use polybuffer on a polyshape.

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!