Dilution of Precision in Java?

Hi everyone! I'm new to Java and I was wondering if anyone knew if anyone has accomplished a DOP or GDOP calculation in Java.
I've been monkeying around with arrays and some low-level matrix stuff. And, Wikipedia has an "equation", but, I dunno how to literally translate an equation into Java just yet.
There used to be some Matlab source on the Inertnet via Google searches but the pages have expired. If I were to get ahold of some Matlab source, is it hard to convert over to Java?
Thanks!
George

817410 wrote:
There used to be some Matlab source on the Inertnet
Inertnet - gotta love that...
via Google searches but the pages have expired.
If I were to get hold of some Matlab source, is it hard to convert over to Java?Google ( [url http://www.google.com/search?q=matlab+java]matlab java ).

Similar Messages

  • [AwesomeWM] mouse cursor precision in java apps

    My mouse cursor isn't really precise in java apps, for example IntelliJ IDEA. The highlighted (and clicked) item is always below the cursor.
    In this case https://docs.google.com/file/d/0B594FZm … sp=sharing (Screenshot) the mouse cursor actually hightlights the row above, but the row below is selected and clicked).
    Last edited by Leandros (2013-04-12 11:59:43)

    I am having the same issue with RubyMine 6 and Oracle JDK 1.7.0_45. Apparently, we are not the only ones. http://unix.stackexchange.com/questions … 454afd0e69 However I have not been able to find any solutions yet.

  • What use of having double precision in java.awt.geom?

    Hi,
    I am trying to draw a line using Line2D with this param:
    g2d.draw( new Line2D.Double( 1.1d, 1.5d, 1.9d, 1.5d ) );
    in my own JPanel paint method.
    However, the result is that the panel does not display a line nor a dot at all. Only when i change it to:
    g2d.draw( new Line2D.Double( 1.0d, 1.5d, 2.0d, 1.5d ) );
    that it draws a dot in the panel's first pixel.
    Can someone please guide or tell me why is this so? And what is the purpose of providing a double value for a geom ( such as Rentagle2D, Line2D, etc )?
    The actual case is that I have created a graph with x and y axis. I set the graph to be 400pixel * 400 pixels. And the scale for the graph is 1 million unit * 1 million unit which means a pixel would have contain (1000000/400) units, or 0.004 pixels represent 1 unit. The problem occurs when i try to draw a line that is only 10 unit.(which nothing is draw on the panel). I try to use all 2D geom with double precision, yet i could not get the result that I wanted. Isn't that java 2D will handle the double precision for graphing or drawing?
    Your help and reply is very much appreciated.
    Thank you.

    have in mind that you always have to fill 1 pixel to see anything as the panel has a 1 pixel grid.
    i guess the thing about double precision is in the contains(...) or crosses(...) methods of the geom.* objects.
    its nothing about drawing. how can you draw finer than the 1 pixel grid.
    even the antialias has to fill more pixel to make you thing the line is smooth. (BTW: antialias makes fonts widt less than 10px look terrible :))

  • How to get nanosecond precision in java?

    After searching through the forums, I realised the inaccuracy of the Thread.sleep(long millis, int nanos) method, which I used in my musical game.( Some other thread titled "try my musical game")
    This could be the main reason I'm getting of tempo midi music....
    Is there a workaround to it? or should I say is there a way to do it within the JDK libraries (non JNI, non Java3D, etc) or any kind of custom code that makes use of the standard libraries to be able to get nanosecond precision?
    I din't really need 1 nanosec precision, but maybe in the 100 nanos.. (0.1 microsec)
    thanks in advance
    ~Jeffrey

    First of all, I don't want to keep fighting at this forum. I just replied
    some guy that said I "didn't want to help".
    It seems you agree with me on Java beeing slow. That's something already.
    You can see above my guessing about the reason why Java is so slow. It's slow because
    the "compiled" Java Code is much bigger than an equivalent C or C++ code would be...
    Java programs run into the JVM, not exactly an example of independence and code optimization. JVM procedures probably are too much for a lot of programs, and therefore just spend memory space and computing time. Maybe, as one of the participants of this forum pointed out, the "Stack Machine" orientation of Java is also a problem when people can't adapt their standard java code (which, after all, is just machine code that we call "Java") to their hardware.
    If we had at least a cross compiler, we could optimize the resulting C or C++ code with one of the many optimizers available, like Intel's.
    Do you disagree? Why?

  • Controlling precision in java float variable

    Hi,
    I need a small clarification. In java, is there any way to control precision of float values.
    For ex, when I perform the below
    float f1 = 0.0F;
    f1 = 200/11;
    The result will be = 18.181818
    But i want only *18.18*. Is there any way to perform this truncation? Please help me on this.
    Thanks

    There is no way to control the precision except on printout where you can use java.text.DecimalFormat or String.format() or java.util.Formatter.
    P.S. The result of
    f1 = 200/11;
    will be 18 not 18.181818... because the division will be done as integers.
    Edited by: sabre150 on Dec 24, 2007 8:44 AM

  • "Java Applet Window" appears in my popup menu

    Hello
    I have added a popup menu to my applet but whenever the popup menu appears, I also get the text "Java Applet Window" at its bottom.
    What is causing this?
    Can I get rid of it?

    Yes you can add a local user policy or local system policy that grants an AWT permission that regards "Java Applet Window" more precisely permission java.awt.AWTPermission "showWindowWithoutWarningBanner";
    You can use a tool to add policy, create new policy files etc. Read about "policytool" in http://java.sun.com/j2se/1.4.1/docs/tooldocs/tools.html
    Probably, signing tha applet jar, you can obtain necessary permission without modifing local policy. But I'm not sure.
    Stefano.

  • Simple division in Java

    Hi all,
    Can someone explain the following to me
    int num1 = 110/60 - answer = 1 (expected)
    float num2 =110/60 - answer also =1 ( not expected)
    How do I get accurate results for my division?
    Thanks

    JoachimSauer wrote:
    Saish wrote:
    Or if you want exact precision, use java.math.BigDecimal.How well does it represent 1/3?
    I just want to show that "exact precision" without a detailed explanation what it actually means can't really be achieved in a general case.
    You can only get:
    1.) more digits
    2.) a closer match to a other (faulty) system that is better-known and thus "looks" more precise (i.e. BigDecimal)
    3.) exact representation for a subset of all values.An exact representation given a precision of n. I am sure it will be impossible to represent transcendental numbers as well. :^)
    - Saish

  • Java calculation

    System.out.println(0.1 + 0.2);
    OUTPUT:0.30000000000000004
    What?
    how precise is java anyway?
    and is there other exemple like this one?

    Well, it is not just java. It is because the way computer represents numbers. We have to learn how to deal with the precision errors and not blaming the computers.
    The computer represents numbers in base 2. This can result in loss of precision since often a binary fraction cannot exactly represent a given finite decimal fraction (0.1 for example). All finite binary fractions, however, can be converted to finite decimal fractions.
    System.out.println(0.1 + 0.2);As long as the number can be converted to a binary fraction, you should get correct numbers. In the example you gave above, 0.1 is not exact in binary format, so you won't get 0.3.

  • How to control time with great precision

    Hello everybody.I know Timer could control time.But it uses thread.sleep(),isn't it.That means it is not guaranteed.So,does anybody know some approach to control time precisely?
    thanks in advance!

    Hello everybody.I know Timer could control time.But it
    uses thread.sleep(),isn't it.That means it is not
    guaranteed.What do you mean by "not guaranteed". How can you expect a non-realtime multitasking OS that uses virtual memory (i suppose you are using a system like windows or linux) to guarantee anything? Some systems are better in this regard, but in addition to this you aslo have the garbage collection. Of course there might be ways to implement soemthing more precise in Java , but without a special VM on a special OS there is no guarantee that it will really work imho.

  • Timing granularity - how precise can I be?

    I have heard noises about Java not being able to handle extremely precise timing tasks. Specifically, I have heard that Timers and Thread.sleep() do not generally perform as might be expected.
    I am working on an application involving serial port traffic, and the spec includes an 80 millisecond timeout between the beginning and end of a packet (If the packet is not complete within 80 milliseconds, drop it and reset the listener).
    Can I expect this level of precision to work accurately? Are the numbers I get from System.currentTimeInMillis() likely to correspond, to the millisecond, to the actual time the byte arrives at the UART?
    If not, I welcome suggestions about how to make this happen.

    You certainly don't need RTJ and you don't need to
    worry about the precision of Java timers either. See
    http://java.sun.com/products/javacomm/javadocs/javax/c
    omm/CommPort.html#enableReceiveTimeout(int). This
    says that the timeout is implemented by the serial
    port driver, not by Java.Interesting, but not useful in this case :
    "when this many milliseconds have elapsed, return immediately from read, regardless of bytes in input buffer."
    The timeout I am monitoring is between the first and last bytes of a message, not for any data recieved.

  • GPS data without a FIX

    Hello
    I couldn´t finish the Part 1 of Homework 3 because my GPS didn't react when plugged on USB with the TTL cable (the FIX led didn't blink). Even though the FIX led blinks with one second rate when the GPS is on the breadboard, using GPIO.
    I write some code to get GPS data, just to print it on console, and besides it didn't get a FIX (the led still blinks on the one second rate), I got the data below (a sample of it):
    $GPGGA,003345.799,,,,,0,0,,,M,,M,,*4E$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003345.799,V,,,,,0.00,0.00,060180,,,N*44$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003346.799,,,,,0,0,,,M,,M,,*4D$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003346.799,V,,,,,0.00,0.00,060180,,,N*47$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003347.799,,,,,0,0,,,M,,M,,*4C$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003347.799,V,,,,,0.00,0.00,060180,,,N*46$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003348.799,,,,,0,0,,,M,,M,,*43$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,1,1,00*79$GPRMC,003348.799,V,,,,,0.00,0.00,060180,,,N*49
    $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003349.799,,,,,0,0,,,M,,M,,*42$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003349.799,V,,,,,0.00,0.00,060180,,,N*48$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003350.799,,,,,0,0,,,M,,M,,*4A$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003350.799,V,,,,,0.00,0.00,060180,,,N*40$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003351.799,,,,,0,0,,,M,,M,,*4B$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003351.799,V,,,,,0.00,0.00,060180,,,N*41$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003352.800,,,,,0,0,,,M,,M,,*47$GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,003352.800,V,,,,,0.00,0.00,060180,,,N*4D$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003353.800,,,,,0,0,,,M,,M,,*46$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,1,1,00*79$GPRMC,003353.800,V,,,,,0.00,0.00,060180,,,N*4C$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003354.800,,,,,0,0,,,M,,M,,*41$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003354.800,V,,,,,0.00,0.00,060180,,,N*4B$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003355.800,,,,,0,0,,,M,,M,,*40$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003355.800,V,,,,,0.00,0.00,060180,,,N*4A$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
    $GPGGA,003356.800,,,,,0,0,,,M,,M,,*43$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003356.800,V,,,,,0.00,0.00,060180,,,N*49$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003357.800,,,,,0,0,,,M,,M,,*42$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003357.800,V,,,,,0.00,0.00,060180,,,N*48$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003358.800,,,,,0,0,,,M,,M,,*4D$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,1,1,00*79$GPRMC,003358.800,V,,,,,0.00,0.00,060180,,,N*47$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003359.800,,,,,0,0,,,M,,M,,*4C$GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,003359.800,V,,,,,0.00,0.00,060180,,,N*46$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003400.800,,,,,0,0,,,M,,M,,*47$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003400.800,V,,,,,0.00,0.00,060180,,,N*4D$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003401.800,,,,,0,0,,,M,,M,,*46$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003401.800,V,,,,,0.00,0.00,060180,,,N*4C$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003402.800,,,,,0,0,,,M,,M,,*45$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003402.800,V,,,,,0.00,0.00,060180,,,N*4F$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003403.800,,,,,0,0,,,M,,M,,*44
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,1,1,00*79$GPRMC,003403.800,V,,,,,0.00,0.00,060180,,,N*4E$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003404.800,,,,,0,0,,,M,,M,,*43$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003404.800,V,,,,,0.00,0.00,060180,,,N*49$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003405.800,,,,,0,0,,,M,,M,,*42$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003405.800,V,,,,,0.00,0.00,060180,,,N*48$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32$GPGGA,003406.800,,,,,0,0,,,M,,M,,*41$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPRMC,003406.800,V,,,,,0.00,0.00,060180,,,N*4B
    $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 (...)
    and so on until stop the application...
    My questions are
    Why I'm receiving GPS data even if it hasn't got a FIX?
    The GPS led at least blinked on both cases for every one? (by USB and GPIO)
    Thanks!

    Hi manasouza,
    for a so called 2D fix are the position for at least three satellites needed. The position of known satellites is send within the GSA record.
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    In your provided record it means that currently no satellites are used for the fix.
    GSA Satellite status
      A Auto selection of 2D or 3D fix (M = manual)
      1 3D fix - values include: 1 = no fix
                                 2 = 2D fix
                                 3 = 3D fix
      12x PRNs of satellites used for fix (space for 12)
      , PDOP (dilution of precision)
      , Horizontal dilution of precision (HDOP)
      , Vertical dilution of precision (VDOP)
      *1E the checksum data, always begins with *
    See also additional information about GPS and the NMEA protocol
    https://en.wikipedia.org/wiki/GPS_signals
    http://www.gpsinformation.org/dale/nmea.htm
    cheers
    Frank

  • How to pass an xml file as a command line argument

    hi,
    i would like to know how to pass xml tags (not an xml file) while running java command. i have already compiled the code and i have a .class file generated. i need to pass this argument in the java command because i am calling a web service which requires an xml as parameter to it.
    to be precise the java code contains soap request and i need to pass xml at run time.
    pl do reply if you have any ideas or solutions...
    Thanks in advance,
    gnsinhyd

    I got the answer myself
    Got the answer myself. I needed the ActionServlet Context in the ActionClass. This is what I have done...
    It works.
    LogonAction.class
    Code:
    InputStream is = getServlet().getServletContext().getResourceAsStream("/WEB-INF/conf/menu.xml");
    XMLMenuBuilder.java
    Code:
    Document document = builder.parse(is);
    Thanks

  • Custom field type - get column name in code

    All,
    I have a custom field type. In the code, I would like to get the column name that the user input. For example, user creates a new column called "Customer" with my custom field type. How can I get the name "Customer" that the user has
    just input?
    Thanks.

    Greetings,
    1) Is it possible to map datatypes? i.e.
    java.util.Date to the sql timestampThe deploytool creates the mapping based on its introspection of your bean. If your bean is coded to 1.1 then it will create the mapping based on your public field types. If coded to 2.0 then it will be based on your abstract accessors (which should conform to JavaBean conventions). Also, it is better to use java.sql.Timestamp to map to SQL timestamps since most DBEs typically store such data in nanosecond precision which java.util.Date is not equipped to handle. :)
    2) Is it possible to map entity bean names and cmp
    fields to the exact database tables and column names?Yes. After you assemble your bean in the wizard, return to the 'Entity' tab and click on 'Deployment Settings' (the SDK deploytool exemplifies the distinction between Application Assembler and Deployer roles... ;). In the resulting dialog you can: specify the datasource for your bean ('Database Settings...'); edit the EJB QL for your finder/select methods ('Edit...') if not done so during assembly; and generate ('Generate Default SQL...') and edit the SQL for your particular resource. Letting the tool generate the ("default") SQL is not really very useful if your database schema is already created but it may help save some typing ':) To edit the SQL click on the method for which to edit and you can then edit (for it) in the 'SQL Query:' TextArea.
    So far I have seen no evidence of either.I hope this helps.
    Many thanks,
    TimRegards,
    Tony "Vee Schade" Cook
    PS... I know this is only meant for development
    testing but these features are fairly standard on theActually, that's the RI's secondary purpose; its primary purpose is to provide a reference for spec implementors to compare their product(s) against. ;)
    main appservers out there and I wouldn't have thought
    it is too difficult to implement in the reference
    implementation. And, indeed, so it is implemented...

  • Double and scientific notation

    Hi,
    I am using a Double to store data but when i output it the value
    is printed in scientific notation example, 2.3333E5..I want to print it as decimal without the 'E' notation, is there a way to format it or set the precision in Java???
    Many Thanks

    You can have a look at NumberFormat and also search this forum because it's a frequently asked question.

  • Oracle Retail Integration - Currency Rate Oracle Object

    Defect 13014568 has been created via Defect Workbench iBug portal request id: (3095217).
    Fix is ready for QA.
    It is planned to be released in RIB 12.0.11.4 bundle, expected by 31st Jan 2012.
    In version 12.0.11:
    The Oracle Object for currency rates CreateCurrencyRateRibObjects has a precision of 10 for the field conversion_rate number:
    DROP TYPE RIB_CurrRateDesc_REC FORCE ;
    CREATE OR REPLACE TYPE RIB_CurrRateDesc_REC UNDER RIB_OBJECT (
    from_currency varchar2(3),
    to_currency varchar2(3),
    conversion_date date,
    conversion_rate number(20,10),
    user_conversion_type varchar2(30),
    OVERRIDING MEMBER PROCEDURE appendNodeValues( i_prefix IN VARCHAR2)
    The XSD for currency rates CurrRateDesc.xsd omits the precision:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="RIBDate.xsd"/>
    <xs:element name="CurrRateDesc">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="from_currency" type="varchar23"/>
    <xs:element name="to_currency" type="varchar23"/>
    <xs:element name="conversion_date" type="RIBDate"/>
    <xs:element name="conversion_rate" type="number20"/>
    <xs:element name="user_conversion_type" type="varchar230"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    Can precision be added to the XSD, to the database precision for java integration?
    Please advise,
    Thanks, Paula
    Edited by: paula on Jan 8, 2012 6:14 AM

    Answer:
    Oracle object is correct. Change the XSD schema to:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="RIBDate.xsd"/>
    <xs:element name="CurrRateDesc">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="from_currency" type="varchar23"/>
    <xs:element name="to_currency" type="varchar23"/>
    <xs:element name="conversion_date" type="RIBDate"/>
    <xs:element name="conversion_rate" type="number20" precision="10" />
    <xs:element name="user_conversion_type" type="varchar230"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="varchar230">
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="varchar23">
    <xs:restriction base="xs:string">
    <xs:maxLength value="3"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="number20">
    <xs:restriction base="xs:decimal">
    <xs:totalDigits value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>
    Then regenerate the typed castor java objects.
    Thanks, Paula

Maybe you are looking for

  • Changing the size of a JComboBox

    Greetings, I am trying to build a mechanism to perform zooming on a JPanel with an arbitrary collection of components (including nested JPanels). I've tried a number of things with little success. The following is my most promising contraption. It ca

  • SELECT OPTIONS IN A FUNCTION

    Hello, I need to use a select options in a Function module and then i have to send the values to a Report program. How can I do it? Thanks.

  • Is it time for a new SSD? Please read my story, my battle with my M4 Crucial SSD

    This is whats been happening the past couple of days and what I have been doing to try and isolate what is causing my fresh win7 install to have so many issues running. IMO, i've narrowed it down to be an issue with my SSD, and not my RAM. Please rea

  • Unable to reverse Service entry sheet posted in earlier prds

    Hi All, We are unable to reverse the service Entry sheet created via Shipment cost document. As the Shipment cost document was created in the month ofJanuary 2011. And now that period is closed. But I am looking the way wherein by changing the postin

  • Advanced-Table in Advanced-Table Query RN

    I'm having difficulty creating a query region in the inner table within an Advanced-Table in Advanced-Table relationship. The inner tables searchable items appear in the outer tables simple search region and an error is raised when I open the detail