#3859: Line's corner_cutoff is poorly documented, and buggy
-------------------------------------+-------------------------------------
       Reporter:  mclean             |        Owner:  was
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.10
      Component:  graphics           |   Resolution:
       Keywords:  plot3d, Line,      |    Merged in:
  corner_cutoff, smoothing           |    Reviewers:
        Authors:  Frédéric Chapoton  |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  u/chapoton/3859    |  10c880c4db6e1c621c96419dbcd33e469033d2c6
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by kcrisman):

 Well, someone is out there but they don't always have time... My only Sage
 time has been with sagenb lately.  But I felt sorry for your ping so I try
 to make time tonight.

 {{{
 The parameter ``corner_cutoff`` is a bound for the cosine of the
         angle made by two successive segments. This angle is close to
         `\pi` if the two successive segments are almost aligned and close
         to `0` if the path has a strong peak.
 }}}
 Maybe one could add parenthetically "(and hence the cosine is close to 1)"
 or the like as appropriate in the two places this occurs?

 {{{
 +        sage: N = 11
 +        sage: c = -0.4
 +        sage: sum([Line([(i,1,0), (i,0,0), (i,cos(2*pi*i/N),
 sin(2*pi*i/N))],
 +        ....:     corner_cutoff=c,
 +        ....:     color='red' if cos(2*pi*i/N)>=c else 'blue')
 +        ....:     for i in range(N+1)])
 }}}
 Super-useful!  I made it into an interact to test things, very nice.

 I do have a question about this.  Why do you have to change the way this
 works?  Why not leave the bounds at 1 and -1 and not switch them?  I hate
 to say the magic word deprecation, and in any case this is just a flat-out
 change.

 For instance, I would say that the angle is nearly ''zero'' if the
 segments "keep on going" and is close to 180 degrees if the segments
 change direction (peak).  So the original seems closer to my thinking -
 it's not the angle at the actual point of contact of the two segments, but
 rather the angle between the ''vectors'' formed by the two (directed) line
 segments that is in question.

 Does that make sense?

 I also have to admit that with #3861 that the output of
 {{{
 Line([(0,0,0),(1,0,0),(2,1,0),(0,1,0)],corner_cutoff=-.5) # current ticket
 }}}
 is bizarre and does not look like the 2d version style in any case.

 Anyway, otherwise this seems to work as advertised.  Should end users have
 access to `max_len` in `Line`?  Currently I don't think that's really
 possible.  But maybe that's okay.

--
Ticket URL: <http://trac.sagemath.org/ticket/3859#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to