Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > math equations in java

Reply
Thread Tools

math equations in java

 
 
Jeremy Watts
Guest
Posts: n/a
 
      05-21-2008
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


jeremy watts
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      05-21-2008
On May 21, 11:19*pm, Jeremy Watts <jwatts1...@hotmail.com> wrote:
> is there any kind of font/typeset (sorry for the vagueness) available
> in java that allows the expression of equations or algebraic
> expressions?


Can you represent them in HTML? If so, most
Swing components will display (simple) HTML.

As an aside, while looking for your superscript,
please look also for your shift key. Applied
once at the start of each sentence, as well as
to the word 'I', it will make your posts more
readable.

--
Andrew T.
PhySci.org
 
Reply With Quote
 
 
 
 
Wojtek
Guest
Posts: n/a
 
      05-21-2008
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
>
>
> jeremy watts


Go to the Eclipse bug report page and create an enhancement request.

https://bugs.eclipse.org/bugs/

--
Wojtek


 
Reply With Quote
 
RedGrittyBrick
Guest
Posts: n/a
 
      05-21-2008
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
 
Reply With Quote
 
Marcus
Guest
Posts: n/a
 
      05-21-2008
Jeremy,
try use the Method pow for expression x^3.
Ex. double a = x, p = 3;
x = double.parseDouble(JOptionPane.showInputDialog("va lue of x"));
JOptionPane.showMessageDialog(null,"x ^ 3 ="+Math.pow(a,p));
This is a sample program, how to use the library Math with method pow.

MarcusJDVL.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-21-2008
On Wed, 21 May 2008 06:19:44 -0700 (PDT), Jeremy Watts
<> wrote, quoted or indirectly quoted someone
who said :

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


http://en.wikipedia.org/wiki/TeX
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Wojtek
Guest
Posts: n/a
 
      05-22-2008
Lew wrote :
> Wojtek wrote:
>> 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

>
>> Go to the Eclipse bug report page and create an enhancement request.
>>
>> https://bugs.eclipse.org/bugs/

>
> ???
>
> What if the OP uses NetBeans? or vi?


We all have our preferences

And I assumed that the OP meant an IDE, as there are no provisions for
text markup within Java.

And the OP could always ask for an enhancement in whatever IDE he/she
is using.

--
Wojtek


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      05-22-2008
Wojtek wrote:
> 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


> Go to the Eclipse bug report page and create an enhancement request.
>
> https://bugs.eclipse.org/bugs/


???

What if the OP accomplishes Statement? or vi?

--
Lew

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[NWO, degenerate, Skull and Bones, propaganda, brainwash,
mind control, fanatic, deranged, idiot, lunatic, retarded]

"I think if you know what you believe,
it makes it a lot easier to answer questions.
I can't answer your question."

--- Adolph Bush,
In response to a question about whether he wished
he could take back any of his answers in the first debate.
Reynoldsburg, Ohio, Oct. 4, 2000
(Thanks to Peter Feld.)

 
Reply With Quote
 
Jeremy Watts
Guest
Posts: n/a
 
      05-23-2008

"bugbear" <bugbear@trim_papermule.co.uk_trim> wrote in message
news: et...
> 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

>
> Do you mean in java code, in an application coded in Java?


Its for use with an application coded in java, so that its output may be
displayed on a screen to a user in a mathematical format.

Jeremy
>
> BugBear



 
Reply With Quote
 
RedGrittyBrick
Guest
Posts: n/a
 
      05-23-2008
Jeremy Watts wrote:
> "bugbear" <bugbear@trim_papermule.co.uk_trim> wrote in message
> news: et...
>> 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

>> Do you mean in java code, in an application coded in Java?

>
> Its for use with an application coded in java, so that its output may be
> displayed on a screen to a user in a mathematical format.
>


So what's wrong with my earlier suggestion?
new JLabel("x\u00B3 + 3x\u00B2 - 5");

--
RGB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
How to show math equations in a GUI stacey Java 6 02-09-2007 08:32 PM
Writing Math Equations in PERL for HTML cylurian@gmail.com Perl Misc 3 02-02-2007 11:36 PM
Re: Is still math.h the C++ math library ? AciD_X C++ 4 04-01-2004 07:29 PM
Why can I not use: Math a=new Math(); chirs Java 18 03-02-2004 06:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57