Report as inappropriate.
To scroll around, click and drag the mouse, or use the arrow keys.
y = tan(x) graphs draw the asymptotes - if this is unwanted I'll make it so this does not happen.
Currently this does not support zooming, so the program treats 1 pixel as 1 unit for the moment.
Also (I'm not sure if/how I'll change this) to create your own graphs you have to download the scenario and do it in Greenfoot. For notes on how to do this, continue reading.
README:
How to add a graph:
(1)Create a sub-class of Graph.class (see below).
(2)Add it in to the graphs[] array on line 15 of Pad.class.
Format for a sub-class of Graph.class:
import greenfoot.*;
public class <name> extends Graph
{
public <name>()
{
formula = "y = <the formula>";
}
protected double getY(double x)
{
return <Your formula in code form>;
}
}
Making getY(double x) - an example:
For the formula "y = 3x^4"
protected double getY(double x)
{
return 3*Math.pow(x, 4);
}
Want to leave a comment? You must first log in.
No votes yet.
2012/3/4
2012/3/4