com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Class: GraphFunction

Source Location: /_includes/lib_graphs.php

Class Overview


Describes a function that can be displayed in a graph.


Author(s):

  • Andreas Launila

Variables

Methods



Class Details

[line 567]
Describes a function that can be displayed in a graph.



Tags:

author:  Andreas Launila


[ Top ]


Class Variables

$name =

[line 573]

The name that should represent the function. The name can be used to identify the function.



Tags:

access:  private

Type:   string


[ Top ]

$values =

[line 580]

The values represent a strict function where the key is the function's parameter and the corresponding value is the function's value for the parameter. Both the parameters and key have to be numerical.



Tags:

access:  private

Type:   array


[ Top ]



Class Methods


constructor __construct [line 591]

GraphFunction __construct( string $name, array $values)

Constructor for GraphFunction.



Tags:

access:  public


Parameters:

string   $name   The name of the function, this acts as an identifier for the function and should hence be unique.
array   $values   The values that represent a strict function where the key is the function's parameter and the corresponding value is the function's value for the parameter. Both the parameters and key have to be numerical.

[ Top ]

method drawFunction [line 660]

void drawFunction( mixed &$img, color $color, integer $startX, integer $startY, integer $highestParam, integer $lowestValue, integer $highestValue, integer $scaleX, integer $scaleY, image $image)

Draws the function at a specified position in a specified image.



Tags:

access:  public


Parameters:

image   $image   The image that the function should be drawn on.
color   $color   The color that should be used when drawing the function, it has to have been allocated to the image.
integer   $startX   The x coordinate (pixels) where the function should start.
integer   $startY   The y coordinate (pixels) where the function should start.
integer   $highestParam   The highest parameter that should be drawn. Any higher parameters should be clipped.
integer   $lowestValue   The lowest value that the function is allowed to take on. Any values lower than this should be clipped.
integer   $highestValue   The highest value that the function is allowed to take on. Any values higher than this should be clipped.
integer   $scaleX   The number of units that each pixel should represent in x axis.
integer   $scaleY   The number of units that each pixel should represent in y axis.

[ Top ]

method getHighestParameter [line 636]

integer getHighestParameter( )

Gets the highest parameter that has a value in the function.



Tags:

return:  A numerical value.
access:  public


[ Top ]

method getHighestValue [line 620]

integer getHighestValue( )

Gets the highest value that is taken by the function.



Tags:

return:  A numerical value.
access:  public


[ Top ]

method getLowestParameter [line 628]

integer getLowestParameter( )

Gets the lowest parameter that has a value in the function.



Tags:

return:  A numerical value.
access:  public


[ Top ]

method getLowestValue [line 612]

integer getLowestValue( )

Gets the lowest value that is taken by the function.



Tags:

return:  A numerical value.
access:  public


[ Top ]

method getName [line 604]

string getName( )

Gets the name of the function.



Tags:

return:  A function name.
access:  public


[ Top ]


Documentation generated on Sun, 16 Apr 2006 21:03:33 +0200 by phpDocumentor 1.3.0RC4