如何将字符串数组中的文本格式化为android的数学格式?

时间:2012-11-30 16:49:55

标签: java android arrays eclipse math

我有一个应用程序,帮助人们使用微积分,我想让它看起来像实际的数学代码而不是看起来像x ^ 2 +(x ^ 1/2)-4的等式。项目中的代码如下。我已经研究了这个主题,但我没有看到明确的解决方案。谢谢!

public class Limits extends Activity implements
    OnClickListener {
private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
private GestureDetector gestureDetector;

View.OnTouchListener gestureListener;

String facts[] = {

//limits
"Find the limit as x approaches 0 of x^3+4x^2+6x+7",
"Find the limit as x approaches infinity of x/x^2",
"Find the limit as x approaches 3 of (x+3)^2/(x+6)",
"Find the limit as x approaches infinity of x^3/x",
"Find the limit as x approaches 3 of (x^2-6x+9)/(x-3)",
"Find the limit as x approaches 7 of 49x^2/7x",
"Find the limit as x approaches infinity of (2x^2-5x+3)/(x^2-7x+7)",
"Find the limit as x approaches 2 of (x − 2/x^2 − 19x + 34)",
"Find the limit as x approaches 6 of ((|x-6|)/(x-6))",

};

1 个答案:

答案 0 :(得分:0)

尝试使用HTML:

Html.fromHtml("X<sup>2</sup>")