首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

画函数图像的计算器解决办法

2011-12-29 
画函数图像的计算器想编一个画函数图像的计算器,把输入的String转化为公式,然后画图。可以不清楚如何转化,

画函数图像的计算器
想编一个画函数图像的计算器,把输入的String转化为公式,然后画图。
可以不清楚如何转化,要用Stack吗?如果有朋友可以帮忙,非常感谢~

[解决办法]
画图像跟计算器扯不上关系吧?
[解决办法]
I think you may have to write a parser.

1, Define function formats.
2, Parse the function string and represent it using Java objects.
3, Plot the graph.

For example, let 's define polynomial function
f(x) = 5 * x^5 + 3 * x^3 + 2 * x^2 - 100;

You may use a List to represent those coefficients of the function. In the above example, those coefficients may be like this; {-100, 0, 2, 3, 0, 5}, corresponding to x^0, x^1, x^2, x^3, x^4, x^5.

After that, you have to plot the graph.

热点排行