Re: math equations in java



Jeremy Watts wrote:
is there any kind of font/typeset (sorry for the vagueness) available
in java that allows the expression of equations or algebraic
expressions?

i am meaning something like x^3 + 3x^2 - 5, where here the '3' and the
'2' indices would be raised to the top right of the 'x' symbol so as
to appear as it would be written in a math text book or whatever.

anyone know what i'm on about here :)

Unicode has some support for those symbols, particularly superscript numerals. So any "Unicode" font with appropriate coverage will do. Actually I expect almost any Latin-1 font will do for your specific expression.


new JLabel("x\u00B3 + 3x\u00b2 - 5")


See
http://unicode.org/charts/PDF/U2200.pdf
http://unicode.org/charts/PDF/U2070.pdf
http://unicode.org/charts/PDF/U0080.pdf


--
RGB
.



Relevant Pages

  • Re: Help me!! Why java is so popular
    ... You are basically arguing that "Java is slow because it is slow". ... > Also, a JVM can pay attention to usage, provide caching, adapt at run ... I have no use for unicode in my ...
    (comp.lang.java.programmer)
  • Re: Schnittstelle - Winsock, String, Unicode
    ... Java arbeitet mit Big Endian Unicode, ... Zeichen aus dem 8bit ziel-Zeichensatz enthält, ... Unicode-Strings unterstützt werden, ...
    (microsoft.public.de.vb)
  • Re: JNI / localization / filenames
    ... fact that Java and Unicode don't match. ... fundamental assumption of the Java programming language and APIs. ... characters and enables the Java platform to continue to track the Unicode ... of 16-bit quantities using UTF-16. ...
    (comp.lang.java.programmer)
  • Re: how do I expand a unicode string to its visual UTF8 representation?
    ... What Java uses internally to represent String ... Java was conceived with Unicode 3.0 in mind, ... which does *not* represent a character ...
    (comp.lang.java.programmer)
  • Re: how to communicate unsigned char* to Java
    ... Actually at this point I think I figured out the code in Java fore reading ... However, my compiler doesn't recognize FileStream and BinaryWriter, ... Strings in Java are Unicode. ... said that java is having unicode-16 for string which is indeed 16 bit ...
    (microsoft.public.win32.programmer.networks)