hexagon logo

Area Calculation from points

I am measuring a feature that is somewhat round but has lot of jagged edges. I want to use all of the areas to calculate the area. I am measuring this using hundreds of points. Anyone have any ideas ? I have searched for answers but can't seem to come up with any.
Parents
  • Dasalo/All

    I've tried to implement this code, not sure if you can help. Currently in offline mode and has 17000pts but still returning zero as the resultant.

    DO/
    $$ NO,
                a= abs((Ax(By-Cy)+Bx(Cy-Ay)+Cx(Ay-By))/2) find area
                ASSIGN/COUNTER=COUNTER+1
                ASSIGN/V1=PRF1.NUMHITS
                ASSIGN/AX=PRF1.HIT[COUNTER].X
                ASSIGN/AY=PRF1.HIT[COUNTER].Y
                ASSIGN/BX=PRF1.HIT[COUNTER+1].X
                ASSIGN/BY=PRF1.HIT[COUNTER+1].Y
                ASSIGN/CY=MAINPT.Y
                ASSIGN/CX=MAINPT.X
                ASSIGN/AREA1CALC=ABS((AX(BY-CY)+BX(CY-AY)+CX(AY-BY))/2)
                ASSIGN/AREA1[COUNTER]=AREA1[COUNTER-1]+AREA1CALC[COUNTER]
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1CALC
                UNTIL/(COUNTER+1) == PRF1.NUMHITS
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1[COUNTER]
Reply
  • Dasalo/All

    I've tried to implement this code, not sure if you can help. Currently in offline mode and has 17000pts but still returning zero as the resultant.

    DO/
    $$ NO,
                a= abs((Ax(By-Cy)+Bx(Cy-Ay)+Cx(Ay-By))/2) find area
                ASSIGN/COUNTER=COUNTER+1
                ASSIGN/V1=PRF1.NUMHITS
                ASSIGN/AX=PRF1.HIT[COUNTER].X
                ASSIGN/AY=PRF1.HIT[COUNTER].Y
                ASSIGN/BX=PRF1.HIT[COUNTER+1].X
                ASSIGN/BY=PRF1.HIT[COUNTER+1].Y
                ASSIGN/CY=MAINPT.Y
                ASSIGN/CX=MAINPT.X
                ASSIGN/AREA1CALC=ABS((AX(BY-CY)+BX(CY-AY)+CX(AY-BY))/2)
                ASSIGN/AREA1[COUNTER]=AREA1[COUNTER-1]+AREA1CALC[COUNTER]
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1CALC
                UNTIL/(COUNTER+1) == PRF1.NUMHITS
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1[COUNTER]
Children
No Data