hw3 - Homework 3 CIS 252(Spring 2011 Introduction to...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 3 CIS 252 (Spring 2011) — Introduction to Computer Science Coverage This assignment covers material through Chapter 3 of Haskell: The Craft of Functional Programming . It also emphasizes use of the design recipe discussed in class. Logistics This homework is officially due in class by Thursday, February 10 . However, it comes with an automatic extension: anything submitted by 1pm on Friday, February 11 will be accepted as being on time. You may work singly or in pairs on this assignment. Background In this homework you will develop a series of little programs about lines in the plane. We start with reviewing some high school math. If necessary, check out http: //mathforum.org/dr.math/faq/formulas/faq.ag2.html#twolines for a bit more background than covered here. Also, follow Polya’s advice and draw pictures as you are reading this. Lines and their equations. Each line in the x - y -plane is given by an equation of the form: a · x + b · y + c = 0 , where a , b , and c are real numbers and at least one of a and b are nonzero. Some examples: 1. The vertical line passing through the point ( 1 , 0 ) is given by: x - 1 = 0 (that is, a = 1, b = 0, and c = - 1). 2. The horizontal line passing through the point ( 0 , - 6 ) is given by: y + 6 = 0 (that is, a = 0, b = 1, and c = 6). 3. The line with slope 2.5 that passes through the point ( 1 , 0 ) is given by: 5 · x - 2 · y - 5 = 0 (that is, a = 5, b = - 2, and c = - 5). Note that any line is given by many equations. For example, the line of example 3 is also given by: 10 · x - 4 · y - 10 = 0 , - 2 . 5 · x + y + 2 . 5 = 0 , x - 0 . 4 · y - 1 = 0 , ... Degenerate lines. An equation of the form 0 · x + 0 · y + c = 0 (that is, an equa- tion with a = b = 0) is called degenerate . (When c = 0, then every point satisfies the equation. When c 6 = 0, no point satisfies the equation.) By convention, we shall consider a degenerate equation as describing a degenerate line (that is, a nonsense line). That way, every equation of the form
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern