import visad.*; public class dataex12 { public static void main (String arg[]) { try { RealType domain = new RealType("temp_F"); RealType range = new RealType("temp_Kelvin"); FunctionType convertTemp = new FunctionType(domain, range); Set domain_set = new Linear1DSet(-40., 212., 2); double[][] values = new double[1][2]; values[0][0] = 233.15; // = -40F values[0][1] = 373.15; // = 212F FlatField convertData = new FlatField(convertTemp, domain_set); convertData.setSamples(values); Real e = new Real(14.0); Data v = convertData.evaluate(e); System.out.println("value for 14.0F = "+v); double vf = (((Real)v).getValue() - 273.15)*9./5. + 32; System.out.println(" or (doing the math) = "+vf); } catch (Exception e) {System.out.println(e);} } }