Questions tagged [jscience]

JScience is a comprehensive Java library for scientific computing.

JScience is a comprehensive Java library for scientific computing. It provides strongly typed mathematical and physical structures, as well as efficient integer, rational, real and complex numbers types.

63 questions
0
votes
1 answer

Grails: how to store jScience Amounts

I am trying to store jscience physics amounts in my grails project. I am using hibernate and defaults, but I would prefer something with general applicability. I am specifically concerned with Mass and if I could have my way I would just make a…
Mikey
  • 4,692
  • 10
  • 45
  • 73
0
votes
0 answers

Library org.geotools.util is missing org.opengis.util.InternationalString?

I see the following exception when running the code below... java.lang.IncompatibleClassChangeError: org/opengis/util/InternationalString is not an interface at java.base/java.lang.ClassLoader.defineClassImpl(Native Method) ~[na:na] …
Kevvvvyp
  • 1,704
  • 2
  • 18
  • 38
0
votes
1 answer

Converting volume (gallons) to mass (grams) using jscience?

I can't seem to find/remember a specific formula to convert units of volume to units of mass. I think it has to do with density, but how would this be done? In my case, I'm trying to write a program using the JScience library to convert any type of…
Kyle Falconer
  • 8,302
  • 6
  • 48
  • 68
0
votes
1 answer

How do I pass kilogram, gram to a kilogram converter and obtain the result in grams

How do I pass kilogram, gram to a kilogram converter and obtain the result in grams (e.g. 5 kg 500 grams = 5500 grams) How to do this using javax.measure.* Refer over here Note: I need the solution only based on the above packages and not some…
Sam
  • 8,387
  • 19
  • 62
  • 97
0
votes
1 answer

Program convert number into words

Can i ask some help? I'm a newbie at programming. It's been a week since i started programming. I've been working on a program that require to input a number and to output the letter of the number you input. My question is. Is there any alternative…
0
votes
1 answer

How can I change or override a factor defined in JScience library?

JScience library implementation uses a set of values for converting units to each other. I am not sure they are defined as constants. I would like to use my own conversion factor to convert meters to feet. Is there any way to accomplish that in…
The_Cute_Hedgehog
  • 1,280
  • 13
  • 22
0
votes
1 answer

Using moment of inertia in jscience

I'm using jscience in a simple physics calculator I'm making. I need to calculate a moment of inerta given some gears and rotating cylinders. I prefer to use jscience, but it seems jscience does not have a measure of moment of inertia? Or is moment…
birgersp
  • 3,909
  • 8
  • 39
  • 79
0
votes
1 answer

Parsing mathml document using JScience

I was trying to parse mathml document using JScience but was not succeed. Following is my piece of code. import JSci.io.*; import JSci.mathml.*; . . public class ParsingMathML(){ try { .... //inputFile is an xml file containing…
chepukha
  • 2,371
  • 3
  • 28
  • 40
0
votes
0 answers

How to import one of JScience's classes?

I am trying to use one of JScience's classes. I downloaded it from the website and I got a zip file. I unzipped the file and got a jar file and some folders. What I am supposed to do now to import the class that I need?
Lucas Alanis
  • 1,208
  • 3
  • 15
  • 30
0
votes
0 answers

How to use dimensionless amount in jscience?

In the API docs it's said that the Amount class has method valueOf. But I don't know how to use it in. I need to create Amount of some dimensionless quantity. Like, you know, 5 apples. Amount.valueOf(100, new Unit()
user1685095
  • 5,787
  • 9
  • 51
  • 100
0
votes
1 answer

How to use jscience constants in java?

I need some of the scientific constants for my project and i found jscience lib. but i can't find a way to use jscience constants. I see the TUTORIAL but there was nothing to explain how to use constants. So how can i use constants in…
max
  • 5,963
  • 12
  • 49
  • 80
0
votes
1 answer

How to write pow to Unit Java (JScience)

I am using JScience API to write units, but I am not able use pow method. How to write pow for unit? Unit centimeter = SI.CENTIMETER; //Unit cm3 = centimeter.pow(3);eclipse suggests to add cast Unit cm3 = (Unit)…
Vijay Vennapusa
  • 169
  • 3
  • 15
0
votes
1 answer

byte[] length from LargeInteger.bitLength()

I'm trying to convert a LargeInteger into a byte[] of unknown length using bitLength() with static byte[] encodeint(LargeInteger y) { //byte[] in = y.toByteArray(); byte[] in = new byte[(int)Math.ceil((double)y.bitLength() / 8.0)]; …
user1382306
0
votes
2 answers

LargeInteger's equivalent of BigInteger's and?

LargeInteger doesn't appear to have an equivalent function to BigInteger's and. Since and(BigInteger val) "Returns a BigInteger whose value is (this & val). (This method returns a negative BigInteger if and only if this and val are both negative.)",…
user1382306
0
votes
1 answer

Java JScience: How to print the whole Real number?

I wrote some testing code which calculated Pi to whatever thing I wanted it to calculate to. It looks something like this: public static void piCalculatorMethod1() { int iteration = 1000000; Real pi = Real.valueOf(0); for (int i = 1; i…
user1432233
  • 63
  • 1
  • 10