[metapost] turningnumber revisited
luigi scarso
luigi.scarso at gmail.com
Tue Jun 28 00:47:38 CEST 2011
2011/6/27 Boguslaw Jackowski <B_Jackowski at gust.org.pl>
>
> Luigi:
>
> 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
>
>
I'm not surprised because at (0,0) (1,1) and (2,0) we don't have C1
continuity (as Dan said).
At (1,1), we enter with (0,1) direction and then exiting with (0,-1) and
this can be done in two different ways:
--->----
| |
| | -180°
^ v
| |
IN OUT
___<__
\ /
\ /
\/ +180°
/\
/ \
/ \
/ \
/ \
IN OUT
For (2,0) and (0,0) we also have two ways :
IN
-->------------+
|
V
OUT | -180°
--<------------+
OUT
--<------------+
|
^ +180°
IN |
-->------------+
BY combining these ways I believe that we can have turning number in
{2,1,0,-1}.
I've still to discover how these ways are calculated when the rotation
change.
With (0,0)..
and ..(2,0) we request to MF to calculate the control points (hence the
OUT and IN directions)
and in this situation this also has some conseguence on the turnig number (I
believe).
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
>
>
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20110628/77bd972e/attachment-0001.html>
More information about the metapost
mailing list