hexagon logo

Extracting 3 largest values?

Is there a way to set up a code to extract the largest 3 values of a group of hits?

I have 9 points around an arc and want to create a circle using the 3 largest -PR- values from the 9 points.

I'm able to get the Max/Min values from the group, but want a way to find the three largest -PR- values.

Thanks,

Parents
  • DIM1 LOC= Location of Point CIR1.HIT[1]

    do this for all 9 hits indexing the "[1]" this will allow you to see the max/min of each hit .There is a way to get the what your asking for but its monday and Im not running at full speed yet.

    maybe something like,

    ASSIGN/HYPOT[N]=SQRT(CIR1[N].X^2+CIR1[N].Y^2)

    then 

    ASSIGN/V1=MAX(HYPOT)
    ASSIGN/V2=MIN(HYPOT)

    COMMENT/OPERATOR

    "MAX POLAR RAIUS = "+V1

    "MIN POLAR RAIUS = "+V2

Reply
  • DIM1 LOC= Location of Point CIR1.HIT[1]

    do this for all 9 hits indexing the "[1]" this will allow you to see the max/min of each hit .There is a way to get the what your asking for but its monday and Im not running at full speed yet.

    maybe something like,

    ASSIGN/HYPOT[N]=SQRT(CIR1[N].X^2+CIR1[N].Y^2)

    then 

    ASSIGN/V1=MAX(HYPOT)
    ASSIGN/V2=MIN(HYPOT)

    COMMENT/OPERATOR

    "MAX POLAR RAIUS = "+V1

    "MIN POLAR RAIUS = "+V2

Children
  • ASSIGN/V1=ARRAY(SQRT((1CR1.HIT[1].X^2)+(1CR1.HIT[1].Z^2)),SQRT((1CR1.HIT[2].X^2)+(1CR1.HIT[2].Z^2)),SQRT((1CR1.HIT[3].X^2)+(1CR1.HIT[3].Z^2)),SQRT((1CR1.HIT[4].X^2)+(1CR1.HIT[4].Z^2)))
    ASSIGN/V2=ARRAY(SQRT((1CR1.HIT[5].X^2)+(1CR1.HIT[5].Z^2)),SQRT((1CR1.HIT[6].X^2)+(1CR1.HIT[6].Z^2)),SQRT((1CR1.HIT[7].X^2)+(1CR1.HIT[7].Z^2)),SQRT((1CR1.HIT[8].X^2)+(1CR1.HIT[8].Z^2)))
    ASSIGN/V3=MAXINDICES(ARRAY(V1[1], V1[2], V1[3], V1[4], V2[1], V2[2], V2[3], V2[4]))
    ASSIGN/V4=SORTDOWN(ARRAY(V1[1], V1[2], V1[3], V1[4], V2[1], V2[2], V2[3], V2[4]))
    My post from his other thread, didn't know he posted twice. I thought at one point there was a trick to continue a variable statement into the next line in PC-DMIS, but I couldn't figure out how.