formula

Calculating a cotangent equation in Scala

One of my nieces had a homework problem where she had to graph the x and y values of this cotangent equation:

y = 3 * cotangent(4 * x)

I couldn’t remember how to graph things like that just by looking at the equation, so I wrote this Scala “cotangent” program:

Eclipse can generate Java hashCode and equals methods

A nice feature of Eclipse is that you can easily generate hashCode and equals methods for your Java class using the editor. You'll really appreciate this capability when you need to create these methods whenever you're doing anything related to sorting, comparisons, comparators, etc.