lines - -- CIS 252, Homework 3-- -- Name: FILL-IN-- Email:

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -- CIS 252, Homework 3-- -- Name: FILL-IN-- Email: FILL-IN------------------------------------------------------------------------------------------------------------------------------------------------ Problem 1------------------------------------------------------------------------- CONTRACT onLine :: (Float,Float) -> Float -> Float -> Float -> Bool-- PURPOSE-- onLine (x1,y1) a b c -- tests whether (x1,y1) is on the line ax+by+c=0.-- EXAMPLES-- (onLine (1,1) 1 1 0) should return False-- (onLine (-1,-1) 1 1 2) should return True-- ****ADD MORE****-- DEFINITION onLine (x,y) a b c = False -- <<<<< CHANGE THIS <<<<<-- TESTS t1a = onLine (1,1) 1 1 0 -- should be False t1b = onLine (-1,-1) 1 1 2 -- should be True t1c = onLine (2,5) (-2) 1 (-1) -- should be True -- ****ADD MORE****------------------------------------------------------------------------------------------------------------------------------------------------ Problem 2------------------------------------------------------------------------- CONTRACT degenerate :: Float -> Float -> Float -> Bool-- PURPOSE-- degenerate a b c -- tests whether the line ax+by+c=0 is degenerate-- EXAMPLES-- (degenerate 0 0 1) should return True-- (degenerate 1 1 0) should return False-- ****ADD MORE****-- DEFINITION degenerate a b c = False -- <<<<< CHANGE THIS <<<<<-- TESTS t2a = degenerate 0 0 1 -- should be True t2b = degenerate 1 1 0 -- should be False-- ****ADD MORE****-------------------------------------------------------------------------------------------------------------------------------------------------- Problem 3-------------------------------------------------------------------------- CONTRACT horizontal :: Float -> Float -> Float -> Bool-- PURPOSE-- horizontal a b c -- tests whether the line ax+by+c=0 is horizontal....
View Full Document

This note was uploaded on 02/14/2011 for the course CIS 252 taught by Professor Staff during the Spring '08 term at Syracuse.

Page1 / 5

lines - -- CIS 252, Homework 3-- -- Name: FILL-IN-- Email:

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