Path: news.mathworks.com!not-for-mail From: "David Hruska" <dhruska@mathworks.com> Newsgroups: comp.soft-sys.matlab Subject: Re: Fall 2012 MATLAB Contest: October 31 - November 7 Date: Mon, 5 Nov 2012 10:33:22 -0500 Organization: MathWorks Lines: 33 Message-ID: <k78m84$ft8$1@newscl01ah.mathworks.com> References: <k4v77h$im6$1@newscl01ah.mathworks.com> <k6ribc$5k7$1@newscl01ah.mathworks.com> <k6rqll$8o4$1@newscl01ah.mathworks.com> <k6s0f8$2o0$1@newscl01ah.mathworks.com> <k6sd64$guk$1@newscl01ah.mathworks.com> <k78ilf$qu$1@newscl01ah.mathworks.com> Reply-To: "David Hruska" <dhruska@mathworks.com> NNTP-Posting-Host: ah-dhruska.dhcp.mathworks.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Trace: newscl01ah.mathworks.com 1352129604 16296 172.28.138.177 (5 Nov 2012 15:33:24 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Mon, 5 Nov 2012 15:33:24 +0000 (UTC) In-Reply-To: <k78ilf$qu$1@newscl01ah.mathworks.com> X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 Xref: news.mathworks.com comp.soft-sys.matlab:782077 > Hi, > I think there is still something wrong with number of knots. > One of the rule is "A node sitting directly on a line counts as two > knots." > For simple set of 4 points: > xy=[-1,0;1,0;0,1;0,0] and a=[0 1 0 0 > 1 0 0 0 > 0 0 0 1 > 0 0 1 0]; > number of knots should be 2, but numKnots returns 1 > and for xy=[-2,0;2,0;-1,0;1,0]; and the same matrix a (one line in other) > it should be 4 knots, but numKnots returns 1 > PozdrawiAM - > Andrzej Hi Andrzej, Thanks for pointing this out. Indeed there is a bug; however, it turns out it's the rules that are not quite right. Any given pair of line segments can intersect at most one time. If a node is sitting directly on a segment, that still counts as just one intersection. When we wrote the bullet point "A node sitting directly on a line counts as two knots" we must have been thinking about the example in the rules where each node is connected to two other nodes. In that specific case, the statement makes more sense but it is not correct in general. Hope this helps. Regards, David MATLAB Contest Team