473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Java Trig Classes for Big Integers

Does anyone know of some public/open source implementations of Trig funtions
- ie sin, cos, tan - for Java that operate with BigIntegers or BigDecimals.
Even better would be a library which can add vectors. I'm starting with
amplitudes and degrees, and need to add the vectors to come out with a
final vector (amplitude).

This kind of thing would be used in Quantum Mechanics/QED for example
perhaps to calculate probabilities. I'm using it for something similar.

I have already googled for a answer and havn't found anything, and I think
I've come to the right news groups - as I can't see any comp.math or
math.comp groups.

Regards,

Peter
Jul 17 '05 #1
2 3302

"Cheetah" <mr****@nothingbutnet.co.nz> wrote in message
news:qE****************@news02.tsnz.net...
Does anyone know of some public/open source implementations of Trig funtions - ie sin, cos, tan - for Java that operate with BigIntegers or BigDecimals. Even better would be a library which can add vectors. I'm starting with
amplitudes and degrees, and need to add the vectors to come out with a
final vector (amplitude).

This kind of thing would be used in Quantum Mechanics/QED for example
perhaps to calculate probabilities. I'm using it for something similar.

I have already googled for a answer and havn't found anything, and I think
I've come to the right news groups - as I can't see any comp.math or
math.comp groups.


Most, though not all, quantum calculations can be done with double.
BigInteger would be inconvenient, as the sin would always be zero. (There
are no integer values of radians for which sin() is -1 or 1.)

Doing trigonometry using decimal arithmetic would be a little slow, though
possible. BigBinary, if it exists, would be a more likely place to look.

How many digits do you actually want?

-- glen
Jul 17 '05 #2
Glen Herrmannsfeldt wrote:
How many digits do you actually want?

-- glen


The simulation I'm doing can create numbers of a few hundred digits long
easily. They are always integers. For example, there are six states, each
state has an integer value and a angle. I need to add all six
states/vectors together to find the final vector.

Oh - I resorted to using the standard Math functions. It turned out accurate
enough for my purposes.

Regards,
Peter
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
2
by: Oliver Plohmann | last post by:
Hello! In JDK1.5 Sun has introduced autoboxing. The user does not need to convert an instance of Integer into an int herself anymore when she wants to do arithmetic operations with the int. The...
235
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
1
by: DarrenJackson007 | last post by:
Hi, Does any one know if any Trig methods exists in the Java API? Ive looked all over the place but would rather not have to make my own classes to do trig functions if I do not have too... ...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
37
by: Razii | last post by:
On Wed, 30 Apr 2008 08:00:38 -0700 (PDT), Isaac Gouy <igouy2@yahoo.comwrote: This time I am going to demonstrate a very serious problem with the shootout site. The algorithms used by C,...
318
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.