Java – draw polynomials

I just want to know how to draw polynomials like x ^ 2 * x ^ 4

Solution

If your environment has good Unicode Fonts, you can relatively easily create your own polynomial tostring() Unicode has all Arabic numerals defined as superscript, most of which are in the superscripts and subscriptions block:

x⁰: U+2070 
x¹: U+00B9  // Not in U207x range!
x²: U+00B2  // Not in U207x range!
x³: U+00B3  // Not in U207x range!
x⁴: U+2074
x⁵: U+2075
x⁶: U+2076
x⁷: U+2077
x⁸: U+2078
x⁹: U+2079
x⁻: U+207B

Therefore, by printing u 0078 u 207B u 2074 u 00b2, X – 2 (x ^ - 42) can be constructed

Note that the font used to print it must define these characters

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>