[metapost] turningnumber revisited

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Mon Jun 27 17:45:14 CEST 2011


Luigi:
> maybe
> from 0 to 1,1 +90°;
> then +180° (hence I have 270°)
> then from 1,1 to 2,0 +90° (hence I have 360°, i.e. turning number = +1)
> then +180° (hence I have 360°+180°)
> then from 2,0 to 0,0 go straight
> then +180° to match the initial position (hence I have 360°+360°
> turning number = +2)

Hmmm...

Then how you would explain the following pattern of the resulting
turning numbers for the first path rotated by an angle between
0 and 90 degree:

angle range  turningnumber
   0--1:           2
   2--9:           0
  10--29:          2
  30--36:          0
  37--44:          2
  45--52:          0
      53:          1
  54--77:          0
  78--85:         -1
  86--88:          0
  89--90:          2

The pattern for the second path is a little bit less complex:

   0--45:          1
  46--74:          0
      75:          1
  76--88:          0
  89--90:          1

Cheers -- Jacko

Ps. The testing code was:

   p:=(0,0)..{up}(1,1) & (1,1){down} .. (2,0) -- cycle ;
   for i:=0 upto 90: show (i,turningnumber (p rotated i)); endfor

and

   p:=(0,0)..{up}(1,1) & (1,1){down} .. (0,1/2) -- cycle ;
   for i:=0 upto 90: show (i,turningnumber (p rotated i)); endfor

respectively.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
----------------------------------------------------------------
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



More information about the metapost mailing list