lsanalysis - #= # Assignment 3 # Name: Yeuan-Shyuan(James)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#====================================== # Assignment 3 # Name: Yeuan-Shyuan(James) Cheng # StudentID: 301001191 #====================================== # #calculate the size of image and graph #how big should the graph magnify def size(minx, maxx): size = 1; if maxx-minx < 11: size = size * 50 elif 10 < maxx-minx < 16: size = size * 30 elif 15 < maxx-minx < 21: size = size * 20 elif 20 < maxx-minx < 51: size = size * 10 elif 50< maxx-minx < 101: size = size * 5 else: size = size return size def fit(rsq): s="" if rsq>0.8: s="good fit" else: s="not a good fit" return s import cgi, Image, ImageDraw, ImageFont i form = cgi.FieldStorage() f #html header print """Content-type: text/html p <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Least Square Analysis</title> <link rel="stylesheet" href="hw3style.css" type="text/css" /> </head> <body> """ " print " <h1>Least Square Analysis</h1>" print " <p> Here is the list of input you specified: </p>" p #testing input ''' x1 = 40.5 x2 = 38.6 x3 = 37.9 x4 = 36.2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
x5 = 35.1 x6 = 34.6 y1 = 104.5 y2 = 102.0 y3 = 100.0 y4 = 97.5 y5 = 95.5
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

lsanalysis - #= # Assignment 3 # Name: Yeuan-Shyuan(James)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online