-- Comp1100 
-- Sem 1, 2006

-- Drawing a parabola y = x^2

-- Clem Baker-Finch March 2006
-------------------------------------------------------- 

module Main where

import Graphics.Plot

main :: IO ()
main
 = 	displayInWindow
		"y = x^2"   -- window title
		(500, 500)  -- window dimensions
		(20,  20)   -- window position
		picture

picture :: Picture	
picture
    = [ Color red
	[ Transform
	  [ Translate 0 (-200) ] -- shift it into the middle of the window
 	  parabola
	]
      ]

parabola :: Picture
parabola
    = [ Line (map parabolaPoints [-200, -190 .. 200]) ]
    where parabolaPoints x = (x, x^2/100)

