public class TableExample4
extends java.lang.Object
This example uses setValueOf to set the value of t and convertToRect to convert r and theta into rectangular coordinates x and y.
The output is printed in a table which could be used to create graph. Parameter t is incremented by PI/20 (about 0.15708) each time.
Sample input to produce values for a 3-leaf rose:
Enter the first value for t: 0
Enter the last value of t: 6.2832
Enter the expression for o (theta) as a function of t: t/2
Enter the expression for r as a function of t or o (theta): cos(3*o)
If more than 2 functions are processed, it many be convenient to create arrays for r, theta, and tree and use a loop to process them.
Requires:
ExprEvaluator.java
EasyFormat.java
DoubleScanner.java
| Constructor and Description |
|---|
TableExample4()
Constructor for TableExample4.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args)
Trivial main program that starts the application.
|