cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
PhamBao
Level III

How to turn matrix from Get Hull Point into clockwise polygon

Hi team,
Is there anyway to turn matrix from Get hull point into clockwise polygon. I got the problem is when I use Polygon(x,y) to draw polygon, where x and y are from Get Hull Points, the polygon is not continuous

Code below:

x_matrix = dt[rows, {FORCEDROPTIME_3 }];
y_matrix = dt[rows, {ACTUAL_MINCHASEFORCEF_3}];
t = Triangulation( x( x_matrix, y_matrix ) ); // from the current rows
ashape = Alpha Shape(t);
ashape << Set Alpha(alpha=0.5);
{ax, ay} = ashape << Get Points();
ashape2 = ashape<< Subset( ashape<< Get Hull Points ); // get data point of boundary
{ashape2_xx, ashape2_yy} = ashape2 << Get Points();
Polygon(ashape2_xx,ashape2_yy);

Refer to polygon with red area in graph below, it seems that red polygon is not correct. I believe that I need to process matrix x and y return from Get Hull Points, so that Polygon() syntax could draw continuous polygon

PhamBao_0-1753282373319.png

Is there anyone having solution to resolve the issue?

Appreciate,

1 REPLY 1
jthi
Super User

Re: How to turn matrix from Get Hull Point into clockwise polygon

You should use JSL formatting when you post JSL code as it makes it much easier to read. I did edit your post to utilize JSL formatting.

You can use formatting by pressing  jthi_0-1753289868252.png from toolbar and then pasting your JSL to the window that opens.

 

-Jarmo

Recommended Articles