hexagon logo

Local MAX and MIN of a circle (two point measure)

For a long time I've been impressed by the mathematics of and today I had a little time over to test something that might come useful some day - "Local MAX and MIN of a circle (two point measure)". Maybe it has been shown before on the forum, but for me it was a new experience and an interesting sojourn in the not so much used "vector calculations" possibilities of PC-DMIS, i.e. the fact that you can get a whole bunch of things calculated with a single command, addressing a vector of numbers.

Assumption:

Circle CIR measured with an even number of points, spread all around.

Method:

Compute all diameters, find the shortest and longest. This is done by simple coordinate distance [SQRT((X1-X0)^2 + (Y1-Y0)^2) ], but the twist is that PC-DMIS can do it for all diameters at once! It just takes three lines.


            ASSIGN/V1=(CIR.HIT[1..CIR.NUMHITS/2].X-CIR.HIT[CIR.NUMHITS/2+1..CIR.NUMHITS].X)^2  ; square the X-diffs
            ASSIGN/V2=(CIR.HIT[1..CIR.NUMHITS/2].Y-CIR.HIT[CIR.NUMHITS/2+1..CIR.NUMHITS].Y)^2  ; square the Y-diffs
            ASSIGN/V3=SQRT(V1+V2)                                                              ; add them and extract square roots

            ASSIGN/MX=MAX(V3)
            ASSIGN/MXI=MAXINDEX(V3)
            ASSIGN/MN=MIN(V3)
            ASSIGN/MNI=MININDEX(V3)

            COMMENT/REPT,
            "Maxindex: "+MXI
            "Max     : "+MX
            "Minindex: "+MNI
            "Min     : "+MN
Parents
  • That "Size" dialog makes a lot of support questions easier to answer in the future! I like it!

    :
    I have verified with a real measurement on a Ø600 ring (circularity = 0.45), 1893 measuring points, and the PC-DMIS 2017 LP size equals my twopoint calculation down to the third (metric) decimal at least, I didn't show more, so I think they have done it right :-) And, when the number of measuring points is 'big enough' it doesn't matter if it's uneven or prime.

    : Is it a secret how PC-DMIS does the LP calculation? Will it protest if the number of points is too small, or is it extrapolating splines and constructing 'real' opposed points under the hood?

Reply
  • That "Size" dialog makes a lot of support questions easier to answer in the future! I like it!

    :
    I have verified with a real measurement on a Ø600 ring (circularity = 0.45), 1893 measuring points, and the PC-DMIS 2017 LP size equals my twopoint calculation down to the third (metric) decimal at least, I didn't show more, so I think they have done it right :-) And, when the number of measuring points is 'big enough' it doesn't matter if it's uneven or prime.

    : Is it a secret how PC-DMIS does the LP calculation? Will it protest if the number of points is too small, or is it extrapolating splines and constructing 'real' opposed points under the hood?

Children
No Data