/**
* This function plots the "functionToPlot" to the plottingArea using '.' as plotting character.
* The origin of the coordinate system of the function is at (xOrigin, yOrigin) within the plottingArea.
* It runs x from xStart to xEnd (both included), calculates y = functionToPlot(x) at each position and translates coordinates accordingly before plotting.
*
* @param xStart the start of the interval of integers for which we plot function values
* @param xEnd the end of the interval of integers for which we plot function values
* @param xOrigin x coordinate of the origin of the coordinate system in the plottingArea
* @param yOrigin y coordinate of the origin of the coordinate system in the plottingArea
*/
public static void plotFunction(int xStart, int xEnd, int xOrigin, int yOrigin) {
int height = plottingArea.length;
for(int i = xStart; i < xEnd; i++) {
int x = i + xOrigin;
int y = functionToPlot(x) + yOrigin;
FunctionPlotter.plotChar(x, y, '.');
FunctionPlotter.printPlottingArea();
}
}
was ist hier Falsch
* This function plots the "functionToPlot" to the plottingArea using '.' as plotting character.
* The origin of the coordinate system of the function is at (xOrigin, yOrigin) within the plottingArea.
* It runs x from xStart to xEnd (both included), calculates y = functionToPlot(x) at each position and translates coordinates accordingly before plotting.
*
* @param xStart the start of the interval of integers for which we plot function values
* @param xEnd the end of the interval of integers for which we plot function values
* @param xOrigin x coordinate of the origin of the coordinate system in the plottingArea
* @param yOrigin y coordinate of the origin of the coordinate system in the plottingArea
*/
public static void plotFunction(int xStart, int xEnd, int xOrigin, int yOrigin) {
int height = plottingArea.length;
for(int i = xStart; i < xEnd; i++) {
int x = i + xOrigin;
int y = functionToPlot(x) + yOrigin;
FunctionPlotter.plotChar(x, y, '.');
FunctionPlotter.printPlottingArea();
}
}
was ist hier Falsch