# measuring a rectangle length and width from a table of data

For a table of x,y,z data points:

{{0.9999, 0.9999, 1000}, {0.9999, 0.99991, 1000}, {0.9999, 0.99992,
1000},...., {1.0001, 1.00008, 50}, {1.0001, 1.00009, 50}, {1.0001, 1.0001,
1000}}


z=A006577(n) at x=y=1, has the same value for z in a rectangular pattern on x and y, where the rectangle is centered on x=y=1 (where n=startN=stopN). Is there a way to find the length and width for this rectangle? Or the number of x and y points that share the same z value for this rectangle? Here is the code that shows the central rectangle, with a length of 9 points and width of 5 points:

collatzStuffC =
Compile[{{c1, _Real}, {c2, _Real}, {nStart, _Integer}, {nStop, \
_Integer}, {maxStepsToCheck, _Integer}},
Module[{stepsForEachN = Table[-1, {i, nStop - nStart}],
stepsForEachNIndex = Table[-1, {i, nStop - nStart}], n = -1,
m = -1}, Table[n = x;
Table[
If[n < 2 && i > 1, {-1, -1, -1},
If[EvenQ[n], n = Round[(n/2)*c1], n = Round[(3*n + 1)*c2]];
m = i;
{x, m, n}], {i, maxStepsToCheck}], {x, nStart, nStop}]]];
Options[collatzData] = {"Coefficient1" -> 1, "Coefficient2" -> 1,
"Start" -> 1, "Stop" -> 10, "MaxIterations" -> 100};
collatzData[OptionsPattern[]] :=
collatzStuffC @@
OptionValue[{"Coefficient1", "Coefficient2", "Start", "Stop",
"MaxIterations"}];
collatzStuff[ops : OptionsPattern[]] :=
With[{cd =
collatzData[
ops]},(*this is just a bunch of vectorized junk to pull the last \
position before the {-1,-1,-1}*)
Extract[cd,
DeveloperToPackedArray@
Join[ArrayReshape[Range[Length@cd], {Length@cd, 1}],
Pick[ConstantArray[Range[Length@cd[]], Length@cd],
UnitStep[cd[[All, All, 1]]], 1][[All, {-1}]], 2]]]

plots3Dlist = {};
startN = 2002;
stopN = 2002;
c1min = 0.9999;
c1max = 1.0001;
c2min = 0.9999;
c2max = 1.0001;
c1step = 0.00001;
c2step = 0.00001;
maxIterations = 1000;
For[abc = startN, abc <= stopN, abc++,
Print[StringForm["loop counter  of ", abc - startN,
stopN - startN]];
thisIsATable =
Table[{c1, c2,
collatzStuff["Coefficient1" -> c1, "Coefficient2" -> c2,
"Start" -> abc, "Stop" -> abc,
"MaxIterations" -> maxIterations][[1, 2]]}, {c1, c1min, c1max,
c1step}, {c2, c2min, c2max, c2step}] // Flatten[#, 1] &;
AppendTo[plots3Dlist,
ListPointPlot3D[thisIsATable, PlotRange -> All]]]
plots3Dlist
thisIsATable
`

This code is from the other question here:

solve for two variables for each n related to Collatz conjecture

I'd like to find the length and width of the rectangle for multiple graphs, and then compare the length and widths to see if there is a pattern.

Here is a picture of the rectangle from the above code with the outline marked. • Looking at the picture, I can't tell quite what you mean by length and width. Is it the length and width of the bounding box of the points? Sep 16 '19 at 21:24
• Hi, yes and the point distance is given by c1step and c2step which in this case are the same = 0.00001, so for a 9 by 5 point bounding box it would be (0.00001*(5-1)) for the length of one side and (0.00001*(9-1)) for the length of the long side of the rectangle. I'm not sure how to find the 5 and 9 values. Sep 17 '19 at 0:12
• Hi, I was thinking about that question a bit more and I guess the most accurate size of the rectangle would maybe use solve or some other technique to find accurate values where the corners are, given by where the value of z changes. Sep 17 '19 at 5:45
• Some of the graphs appear to have rectangles with infinite length, but I think all graphs have bounded width of the rectangles, so the width might be the only number that is needed, but identifying the numbers that have infinite length rectangles would be good too. Sep 17 '19 at 6:55
{"ft_lang_label":"__label__en","ft_lang_prob":0.62875813,"math_prob":0.99436545,"size":2562,"snap":"2021-43-2021-49","text_gpt3_token_len":913,"char_repetition_ratio":0.10633307,"word_repetition_ratio":0.021276595,"special_character_ratio":0.40124902,"punctuation_ratio":0.2740472,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.995606,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-22T18:34:01Z\",\"WARC-Record-ID\":\"<urn:uuid:1a192877-0e74-4581-ab99-3843764959a3>\",\"Content-Length\":\"161645\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d6f5fbe1-6dde-43df-a8e6-86d7fbbd03da>\",\"WARC-Concurrent-To\":\"<urn:uuid:652c6eb9-4690-4727-bf06-dc148e30bbfc>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/206336/measuring-a-rectangle-length-and-width-from-a-table-of-data\",\"WARC-Payload-Digest\":\"sha1:N24BOOQDBD4E3MD6UKEDDEZEYKYRLDAE\",\"WARC-Block-Digest\":\"sha1:PYZ7PSYPRR3TWD2XVCJURAHX6RY7F7CD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585518.54_warc_CC-MAIN-20211022181017-20211022211017-00118.warc.gz\"}"}