#8353: Adding height() and width() functions to square grid paths
-----------------------------+----------------------------------------------
   Reporter:  abmasse        |       Owner:  sage-combinat       
       Type:  enhancement    |      Status:  needs_review        
   Priority:  major          |   Milestone:  sage-4.3.4          
  Component:  combinatorics  |    Keywords:  paths, height, width
     Author:                 |    Upstream:  N/A                 
   Reviewer:                 |      Merged:                      
Work_issues:                 |  
-----------------------------+----------------------------------------------
Description changed by abmasse:

Old description:

> When dealing with 2d word paths, it is very useful to know their height
> and their width.
>
> In particular, one can compute a bounding box for a better displaying.
> The aim of this small ticket is to add those two functionalities.
>
> By the way, while testing it, I noticed a strange behavior:
>
> {{{
> sage: Paths = WordPaths('abcABC')
> sage: p = Paths('acABC')
> sage: points = list(p.points())
> sage: points
> [(0, 0), (1, 0), (1/2, 1/2*sqrt3), (-1/2, 1/2*sqrt3), (-1, 0), (-1/2,
> -1/2*sqrt3)]
> sage: y_coords = map(lambda (_,y):y, points)
> sage: y_coords
> [0, 0, 1/2*sqrt3, 1/2*sqrt3, 0, -1/2*sqrt3]
> sage: max(y_coords)
> -1/2*sqrt3
> }}}

New description:

 When dealing with 2d word paths, it is very useful to know their height
 and their width.

 In particular, one can compute a bounding box for a better displaying. The
 aim of this small ticket is to add those two functionalities.

 By the way, while testing it, I noticed a strange behavior:

 {{{
 sage: Paths = WordPaths('abcABC')
 sage: p = Paths('acABC')
 sage: points = list(p.points())
 sage: points
 [(0, 0), (1, 0), (1/2, 1/2*sqrt3), (-1/2, 1/2*sqrt3), (-1, 0), (-1/2,
 -1/2*sqrt3)]
 sage: y_coords = map(lambda (_,y):y, points)
 sage: y_coords
 [0, 0, 1/2*sqrt3, 1/2*sqrt3, 0, -1/2*sqrt3]
 sage: max(y_coords)
 -1/2*sqrt3
 }}}

 Shouldn't `1/2*sqrt3` be the highest element ? This doesn't make sense.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8353#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to