stepthom / math-fun

Just testing out some fun with mathematics.
2 stars 2 forks source link

Find slope of linear funtion #20

Closed stepthom closed 11 years ago

stepthom commented 11 years ago

This issue depends on issue #18 being resolved first, and probably #19 as well.

Add a method computeSlope() that computes the slope of a linear function.

Add unit tests to make sure the function behaves as expected.

Add the slope to the output for linear functions, e.g.,

<function>
  <output>
    f(x) = 3x^1 - 11
  </output>
  <derivative>
    f(x) = 3 
  </derivative>
  <slope>
    3
  </slope>
</function>

(Of course, the example above assumes that issue #14 is complete, too.)