Examples of Rational


Examples of edu.harvard.hul.ois.ots.schemas.XmlContent.Rational

            if (tok.hasMoreElements())
                min = Integer.parseInt (tok.nextToken ());
            if (tok.hasMoreElements())
                sec = Double.parseDouble (tok.nextToken ());
           
            elem.setDegrees (new Rational (deg, 1));
            elem.setMinutes (new Rational (min, 1));
            elem.setSeconds (new Rational ((int) (sec * 100), 100));
        }
        catch (Exception e) {
        }
    }
View Full Code Here

Examples of edu.harvard.hul.ois.ots.schemas.XmlContent.Rational

                    Double dblValue = null;
                    try {
                        dblValue = Double.parseDouble (dataValue);
                    }
                    catch (NumberFormatException e) {}
                    Rational ratValue = null;
                    if (intValue != null) {
                        ratValue = new Rational (intValue, 1);
                    }
                    else if (dblValue != null) {
                        ratValue = new Rational ((int) (dblValue * 100 + 0.5), 100);
                    }
                    else if(dataValue.contains("/")) {
                      try {
                        int num = Integer.parseInt(dataValue.substring(0,dataValue.indexOf("/")));
                        int den = Integer.parseInt(dataValue.substring(dataValue.indexOf("/")+1));
                        ratValue = new Rational(num,den);
                      }
                      catch (NumberFormatException e) {}
                    }
                   
                    // This is a very long switch, but I don't think much would be gained
View Full Code Here

Examples of mediautil.gen.Rational

        try {
            return TV_TO_SEC[(int) ((Rational) e.getValue(0)).floatValue()];
        } catch (NullPointerException x) {
        } catch (ArrayIndexOutOfBoundsException x) {
        }
        return new Rational(0, 1);
    }
View Full Code Here

Examples of mediautil.gen.Rational

            ifds[1] = new IFD(1);
            ent = new Entry(SHORT);
            ent.setValue(0, new Integer(2));
            ifds[1].addEntry(RESOLUTIONUNIT, ent);
            ent = new Entry(RATIONAL);
            ent.setValue(0, new Rational(180, 1));
            ifds[1].addEntry(XRESOLUTION, ent);
            ent = new Entry(RATIONAL);
            ent.setValue(0, new Rational(180, 1));
            ifds[1].addEntry(YRESOLUTION, ent);
        }

        String ext = thumbnailExt.toLowerCase();
View Full Code Here

Examples of mediautil.gen.Rational

                    if (type % RATIONAL != 0)
                        // Not a fraction
                        values[j] = new Integer(s2n(offset, typelen, signed));
                    else
                        // The type is either 5 or 10
                        values[j] = new Rational(s2n(offset, 4, signed), s2n(
                                offset + 4, 4, signed));
                    offset += typelen;
                    // Recent Fujifilm and Toshiba cameras have a little subdirectory
                    // here, pointed to by tag 0xA005. Apparently, it's the
                    // "Interoperability IFD", defined in Exif 2.1.
View Full Code Here

Examples of musicwriter.donnees.Rational

             //dureeAInserer = Duree.getDureeNulle();
             dureeAInserer = new Duree(momentDebut, getSysteme().getMoment(evt.getPoint()));
         }
         else
         {
             dureeAInserer = new Duree(new Rational(((int) (evt.getX() -  getXMoment())) / (int) Systeme.getNbpixelDureeNoireParDefaut(), 1));
         }
         getController().repaint();
    }
View Full Code Here

Examples of numbers.Rational

    BSTree tree = new BSTree();
    tree.create_empty();
   
    for (int i = 0; i < input.length; ++i) {
      String[] rational = input[i].split("/");
      Rational rat = null;
      if(rational.length==2)
        rat = new Rational(Integer.parseInt(rational[0]), Integer.parseInt(rational[1]));
     
      if(rational.length == 1)
        rat = new Rational(Integer.parseInt(rational[0]), 1);
     
      if(rat != null)
        tree.insert(rat);
    }
   
View Full Code Here

Examples of org.jscience.mathematics.number.Rational

            System.out.println("Precision = " + sqrt2.getPrecision()
                    + " digits.");

            LargeInteger dividend = LargeInteger.valueOf("3133861182986538201");
            LargeInteger divisor = LargeInteger.valueOf("25147325102501733369");
            Rational rational = Rational.valueOf(dividend, divisor);
            System.out.println("rational  = " + rational);

            ModuloInteger m = ModuloInteger.valueOf("233424242346");
            LocalContext.enter(); // Avoids impacting others threads.
            try {
View Full Code Here

Examples of org.monte.media.math.Rational

      Format format=new Format(
          EncodingKey, ENCODING_QUICKTIME_PNG,
          DepthKey,24);
      format=format.prepend(
          MediaTypeKey, MediaType.VIDEO, //
          FrameRateKey, new Rational(fps, 1),//
          WidthKey, w, //
          HeightKey, h);

      qt.addTrack(format);
View Full Code Here

Examples of uk.co.mmscomputing.math.Rational

    return data;
  }

  private double read1Real(ImageInputStream in)throws IOException{
    switch(type){
    case RATIONAL:  return new Rational((int)in.readUnsignedInt(),(int)in.readUnsignedInt()).doubleValue();
    case SRATIONAL: return new Rational(in.readInt(),in.readInt()).doubleValue();
    case FLOAT:     return in.readFloat();
    case DOUBLE:    return in.readDouble();
    default:/*error*/return 0;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.