summary refs log tree commit diff stats
path: root/doc
Commit message (Expand)AuthorAgeFilesLines
* ranger.1: added S key to man pagehut2010-04-161-0/+3
* Fixed suggested cd-after-exit-script for zshhut2010-04-131-1/+1
* added doc/print_keys.pyhut2010-04-081-0/+14
* corrected documentationhut2010-04-061-1/+1
* Improved tabshut2010-04-061-0/+3
* updated keybindings and documentationhut2010-04-061-1/+21
* ranger.1: updatehut
import types/vector

type
  Line* = object
    p0*: Vector2D
    p1*: Vector2D

  LineSegment* = object
    line: Line
    miny*: float64
    maxy*: float64
    minyx*: float64
    islope*: float64

func minx*(line: Line): float64 =
  return min(line.p0.x, line.p1.x)

func maxx*(line: Line): float64 =
  return max(line.p0.x, line.p1.x)

func minyx*(line: Line): float64 =
  if line.p0.y < line.p1.y:
    return line.p0.x
  return line.p1.x

func maxyx*(line: Line): float64 =
  if line.p0.y > line.p1.y:
    return line.p0.x
  return line.p1.x

func miny
hut2010-01-013-35/+2
* cleanupshut2009-12-311-1/+5
* rename filelist(container) to browsercolumn/browserviewhut2009-12-313-38/+76
* updated uml projecthut2009-12-305-73/+215
* shorten comment in ranger.pyhut2009-12-261-0/+4
* moved /uml to /doc/umlhut2009-12-2514-0/+2180
* Explained cd-after-exit featurehut2009-12-251-0/+132
* moved pydoc pages to doc/pydochut2009-12-2565-0/+0
* updated pydoc pageshut2009-12-2565-0/+10505
lass="n">xdiff # inverse slope func islope*(line: Line): float64 = let ydiff = (line.p0.y - line.p1.y) if ydiff == 0: return 0 return (line.p0.x - line.p1.x) / ydiff proc cmpLineSegmentY*(l1, l2: LineSegment): int = return cmp(l1.miny, l2.miny) proc cmpLineSegmentX*(l1, l2: LineSegment): int = return cmp(l1.minyx, l2.minyx) func p0*(ls: LineSegment): Vector2D {.inline.} = ls.line.p0 func p1*(ls: LineSegment): Vector2D {.inline.} = ls.line.p1 converter toLineSegment*(line: Line): LineSegment = LineSegment( line: line, miny: line.miny, maxy: line.maxy, minyx: line.minyx, islope: line.islope )