use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testArccoth.
@Test
public void testArccoth() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Arccoth.class, out, in);
final double result = 0.5 * Math.log(1234567891.0 / 1234567889.0);
assertEquals(out.get(), result, 0.0);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testArctan.
@Test
public void testArctan() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Arctan.class, out, in);
assertEquals(out.get(), Math.atan(1234567890), 0.0);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testLog2.
@Test
public void testLog2() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Log2.class, out, in);
assertEquals(out.get(), Math.log(1234567890) / Math.log(2), 0.0);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method testCosh.
@Test
public void testCosh() {
final LongType in = new LongType(1234567890);
final DoubleType out = new DoubleType();
ops.run(Cosh.class, out, in);
assertEquals(out.get(), Math.cosh(1234567890), 0.0);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method assertArccsc.
// -- Helper methods --
private void assertArccsc(final double i, final double o) {
final DoubleType in = new DoubleType(i);
final DoubleType out = (DoubleType) ops.run(Arccsc.class, in.createVariable(), in);
assertEquals(o, out.get(), 1e-15);
}
Aggregations