  % Title "Console Demo"
 '% Animated
 '% ScaleUp
 '% PlaceCentral
 '% AnchorCentral
  uses consoleG
  uses GLO2\GeoPlanar

  sub drawintersections()
  =======================

  string tab="    "
  line   d1,d2,d3,d4,d5
  line   d6,d7,d8,d9,d10
  point  p
  sys    a

  'shading
  'flat 'default

  'GRID
  d1={-1.0,0.00, 1.0,0.00}
  d2={-1.0,0.25, 1.0,0.25}
  d3={-1.0,0.50, 1.0,0.50}
  d4={-1.0,0.75, 1.0,0.75}
  d5={-1.0,1.00, 1.0,1.00}
  '
  d6={-1.0,0.0, -1.0,1.0}
  d7={-0.5,0.0, -0.5,1.0}
  d8={-0.0,0.0, -0.0,1.0}
  d9={ 0.5,0.0,  0.5,1.0}
 d10={ 1.0,0.0,  1.0,1.0}
  '
  color 0,1,1
  printl "Grid" tab p.x tab p.y
  scale 7,7
  move 1,-1
  '
  gosub draws
  '
  move 0,-2
  
  'GRID SKEW
  'horizontal lines
  d1={-1.0,0.00, 1.0,0.00}
  d2={-0.8,0.25, 1.2,0.25}
  d3={-0.6,0.50, 1.4,0.50}
  d4={-0.4,0.75, 1.6,0.75}
  d5={-0.2,1.00, 1.8,1.00}
  '
  'vertical oblique  lines
  d6={-1.0,0.0, -0.2,1.0}
  d7={-0.5,0.0,  0.3,1.0}
  d8={-0.0,0.0,  0.8,1.0}
  d9={ 0.5,0.0,  1.3,1.0}
  d10={ 1.0,0.0, 1.8,1.0}

  gosub draws


  exit sub

  draws:
  ======
  color 0,1,1
  drawline @d1
  drawline @d2
  drawline @d3
  drawline @d4
  drawline @d5
  ;
  drawline @d6
  drawline @d7
  drawline @d8
  drawline @d9
  drawline @d10
  '
  color 1,1,0
  pointsize 7
  a=intersected d1,d6,p
  drawpoint @p
  a=intersected d2,d7,p
  drawpoint @p
  a=intersected d3,d8,p
  drawpoint @p
  a=intersected d4,d9,p
  drawpoint @p
  a=intersected d5,d10,p
  drawpoint @p
  ret

  end sub


  sub main()
  ==========
  string s
  cls 0,0,0
  pushstate
  scale 2,2
  'typeface=1
  printl "Intersection Points"
  popstate
  '
  move 0,-2
  '
  PushState
  move 1,-1
  DrawIntersections
  PopState
  '
  
  end sub

  EndScript
