com.ijchart.xychart.function
Class PowerFunction

java.lang.Object
  extended by com.ijchart.xychart.function.PowerFunction
All Implemented Interfaces:
IFunction, java.io.Serializable

public class PowerFunction
extends java.lang.Object
implements IFunction, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A function of the form y = a * x ^ b.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Constructor Summary
PowerFunction(double a, double b)
           Constructs a new power function.
 
Method Summary
 boolean equals(java.lang.Object obj)
           Override equals method.
 double getA()
           Returns the 'a' coefficient.
 double getB()
           Returns the 'b' coefficient.
 double getY(double x)
           Calculate the y value for a given inpu x.
 int hashCode()
           Returns a hash code value for the object.
 java.lang.String toString()
           Override toString method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PowerFunction

public PowerFunction(double a,
                     double b)
Constructs a new power function.

Parameters:
a - double The 'a' coefficient.
b - double The 'b' coefficient.
Method Detail

getA

public double getA()
Returns the 'a' coefficient.

Returns:
double The 'a' coefficient.

getB

public double getB()
Returns the 'b' coefficient.

Returns:
double The 'b' coefficient.

getY

public double getY(double x)
Calculate the y value for a given inpu x.

Specified by:
getY in interface IFunction
Parameters:
x - double The x value.
Returns:
double The y value.

equals

public boolean equals(java.lang.Object obj)
Override equals method.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

toString

public java.lang.String toString()
Override toString method.

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.