The pythagoren theorem

I need help with printing out this formula.
a^2 + b^2 = hypotenus^2
heres a code I have been given for a little help, but it doesn't work
I keep getting an error (unexpected type).
a = sqrt (hypotenuse2 - b2 )
I figured it was because the 2's werent written in the power form so i tried...
a = sqrt (hypotenuse^2 - b^2 )
an i still get the error. If anyone can help me with nmaking the powers work, that would greatly be appreciated. Thanks!
Jbinks~ .

Actually, this will do:
int a=(int)Math.sqrt(hypotenuse*hypotenuse-b*b);There's an implicit conversion done for you.
Here's how I'd do it:
public class Pythagoras
    public static void main(String [] args)
        try
            if (args.length > 1)
                double c = Double.parseDouble(args[0]);
                double b = Double.parseDouble(args[1]);
                double a = Pythagoras.calculateSide(b, c);
                System.out.println("a: " + a);
                System.out.println("b: " + b);
                System.out.println("c: " + c);
        catch (Exception e)
            e.printStackTrace();
    public static double calculateHypotenuse(double a, double b)
        if ((a < 0.0) || (a < 0.0))
            throw new IllegalArgumentException("euclidian space triangle sides must be positive");
        if (a > b)
            double r = b/a;
            return a*Math.sqrt(1.0+r*r);
        else
            double r = a/b;
            return b*Math.sqrt(1.0+r*r);
    public static double calculateSide(double b, double c)
        if ((b < 0.0) || (c < 0.0))
            throw new IllegalArgumentException("euclidian space triangle sides must be positive");
        double r = b/c;
        if (r > 1.0)
            throw new IllegalArgumentException("hypotenuse is longer than either side");
        return c*Math.sqrt(1.0-r*r);
}%

Similar Messages

  • PYTHAGORAS THEOREM

    I need to know if anyone has coded the pythagoras theorem using areas of squares to prove the theorem.
    I have got a triangle on screen with my angles and side lengths displayed in a jtable. I need to extend it to display the sides as squares.
    such that the ares of the side and the base = area of the square from the hypotenuse..
    PLEASE REPLY SOON

    such that the ares of the side and the base = area of
    the square from the hypotenuse..You only have to display the square of the three sides. Pythagoras will personally take care of the theorem for you from his small study in Math Heaven.

  • Signal Conditioning and Shannon Theorem

    Hi, 
    I need to acquire a signal and then to condition it. I am planning on using the SCX-1102 which has a lowpass filter (2Hz).
    I would like to know if this lowpass filter has to respect the shannon theorem and has to be > 2*fmax.
    In my case.. the fmax of my signal is 1.5Hz.
    Thank you! 

    Hello,
    I assume you are referring to the Nyquist-Shannon sampling theorem that states that the sampling frequency must be at least twice the frequency of the signal.  This applies to sampling, not low pass filters.  Just make sure you sample at a high enough rate (more than twice, 10x is better, the expected frequency of your signal - including all frequency content, even frequencies that you would like to filter out), and then the filter will eliminate frequencies above 2 Hz.  
    - Christina

  • Pythagorean theorem

    Dear Colleagues
    I have recently managed to find the length of the hypotenuse given the lengths of the two opposing sides using sqrt.
    I have read that sqrt must be placed after Math because it is part of that class's family.
    Just so that I can practice a bit other Math classes, does anybody know which keywords I can use? For instance, how could I use cubic root? Incidentally, why is it Math and not Maths? Isn't it mathematicS?
    Use the Pythagorean theorem to find the length
    of the hypotenuse given the lengths of the two opposing sides.
    class Hypot {
    public static void main(String args[]) {
    double x, y, z;
    x = 3;
    y = 4;
    z = Math.sqrt(x*x + y*y);
    System.out.println("Hypotenuse is " +z);
    The output is:
    Hypotenuse is 5.0
    Cheers!
    Steve

    As defined:
    maths Pronunciation Key (mths)
    n. Chiefly British (used with a sing. verb)
    Mathematics.
    Source: The American Heritage� Dictionary of the English Language, Fourth Edition
    Copyright � 2000 by Houghton Mifflin Company.
    Published by Houghton Mifflin Company. All rights reserved.
    It appears to be a Britishism. Or Unitedism Kingdomism. Or Merry ol' Englandism.
    Just having fun everyone. No disrespects to those whom feel slighted. It is much too nice a day to conflict with our neighbors to the East.

  • Circle Theorem Problem

    Hi everyone,
    Im new to java and would like some help in developing a certain circle theorem -
    THe circle Theorem states that -
    Angles at the circumference which are all in the same segment are all eequal-
    I need to demonstrate this by letting the user click on the circle and drag it about on screen as well as giving him the option to drag and change the chords which contain the angles to prove that no matter where the chords are in the circle the angle that they form is always the same -
    Plus - I need a table which would show the values of the Circles Area , Circumference and the angles like Angle A, Angle B and Angle C etc.
    The chords when touching the circumference should display a point which the user can drag..
    Please help or give me some hint as to how you would go about developing it.
    Cheers
    Gob.

    Your pretty diagram won't actually prove anything, but I suppose your teacher was looking for a nice problem.
    First, write the code to draw a circle.
    Then amend it to have a parameter theta and draw the chords from your chosen diameter to a point on the circle at angle theta from some arbitrary point.
    Then write a MouseListener and a MouseMotionListener to track mouse clicks and drags and update theta.
    Finally add the display.
    If you find that any of your code for these steps doesn't work, post it in this thread, being sure to use [co[b]de] tags to mark it up.

  • Is my query the very last bit of sql sent through cfquery?

    I have Coldfusion 9 on a Windows Server 2008 box. I have a datasource that points to a Windows Server 2000 with SQL Server 2000. My goal with this template was to determine if my SQL server was recieving any traffic. We anticipate that one or two databases may have select statements being run against it. So, we figured we could use this template to produce proof of activity. (if a process's last query is different from the last one we logged, then that confirms that our sql server is still recieving activity)
    <cfquery name="processes" datasource=#dsn#>
        USE master
        SELECT * from sysprocesses where spid > 50
    </cfquery>
    <cfloop query="processes">
        <cfquery name="lastquery" datasource=#dsn#>
            DBCC INPUTBUFFER(#duckprocesses.spid#)
        </cfquery>
    You can see that I'm using DBCC INPUTBUFFER to determine what the last query was. Utilizing the field called #lastquery.eventinfo# I was hoping to see some queries connected to our datasource. After testing however, I am not getting any proof of my coldfusion server sending sql to my sql server. The queries were successful, because they returned data to my test coldfusion  page, but I couldn't find my query in the inputbuffer command. I know it works, because my sql server queries (run locally on the sql server) returned some results and would properly show up after using the INPUTBUFFER command. However, when I send some queries via <CFQUERY> I do not see the queries in the inputbuffer command.  I do see the following "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" next to the IP address of my Coldfusion server. So that leads me to believe that there is some transactional safety inherit with coldfusion.
    Does coldfusion send ONLY my query to the database server or does it also come inherit with some transactional sql? Like when your CFM throws an error after a <cfquery>INSERT some rows here</cfquery> and the inserted rows do not show up because an error was thrown a few lines down?

    I suggest that you look closely at the MySQL function library reference material for the version of MySQL that you are running ... and, consider upgrading if you need to.
    In any case, you might be able to get more precision by asking for it, e.g. with the CAST() and CONVERT() functions.
    The MySQL documentation (as recently as 5.0) discusses precision math functions.
    Most significantly, though, it seems that MySQL now offers a library of geo-spatial (GIS) functions which might make it possible for you to go well beyond the Pythagorean Theorem in addressing your problem.  The boundaries of each ZIP Code are, of course, a closed polygon, and what you are really looking for here is to determine containment of a chosen point within this and/or adjacent polygons.  MySQL 5.0, for instance, appears to have considerable direct support for this.  You do have to purchase these data sets.
    See:  http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

  • Game and Ball Hit problem

    Hello everyone, I am working on a game and was wondering if I could get some help. I have a ball that bounces around in a box, and place one small ball in the applet. I want to create an effect that when the ball that is moving comes into connect with the static ball, the moving ball bounces in the opposite direction. I used this:
    if(x_pos - 100 < 2 & y_pos - 100 < 2 || 100-x_pos < 2 && 100 - y_pos < 2)
    where x_pos and y_pos are for the moving ball, and 100 is the radius of the static ball. Should I use the Pythagoras theorem to do it?
    Thank You In Advance for any help.

    Use java.awt.Shape and its contains() method. It's a standard collision detection idiom.

  • How to find a point lies inside circle

    Hi,
    How do I find a point (x,y) is lies inside a circle? I trying to do a small shooting game.
    If the user clicks inside the circle they get a point. I am using the Pythagoras theorem to achieve this. But I can't.
    Please advice me.
    Here is my code
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Shoot extends JFrame implements MouseListener, MouseMotionListener
        private int winWidth = 300;
        private int winHeight = 300;
        private MyCanvas canvas = null;
        private int ballX = 50;
        private int ballY = 50;
        private int ballW = 50;
        private int ballH = 50;
        private int ballR = ballW / 2;
        private int curX = 0;
        private int curY = 0;
        private int left = 0;
        private int top = 0;
        public Shoot()
            Cursor c = new Cursor(Cursor.CROSSHAIR_CURSOR);
            this.setCursor(c);
            canvas = new MyCanvas();
            packIt();
            left = getInsets().left;
            top = getInsets().top;
        private void packIt()
            setTitle("My first game!");
            setPreferredSize(new Dimension(winWidth, winHeight));
            setSize(new Dimension(winWidth, winHeight));
            setContentPane(canvas);
            addMouseListener(this);
            addMouseMotionListener(this);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //setUndecorated(true);
            setLocation(300, 0);
            setVisible(true);
        public void mouseClicked(MouseEvent e)
            int x = e.getX() - left - ballX;
            int y = e.getY() - top - ballY;
            int r = ballR;
            System.out.println("x :" + x + "\ty :" + y);
            //Trying to implememt Pythagoras theorem. But I am missing something.
            System.out.println(((x * x) + (y * y)) + "\t=\t" + (r * r));
            System.out.println();
        public void mousePressed(MouseEvent e)
        public void mouseReleased(MouseEvent e)
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mouseDragged(MouseEvent e)
        public void mouseMoved(MouseEvent e)
            curX = e.getX() - left;
            curY = e.getY() - top;
            canvas.repaint();
        private class MyCanvas extends JPanel
            public MyCanvas()
                setBackground(Color.BLACK);
                setBorder(BorderFactory.createLineBorder(Color.yellow));
            public void paintComponent(Graphics g)
                super.paintComponent(g);
                g.setColor(Color.WHITE);
                g.drawString("x :" + curX, 10, 20);
                g.drawString("y :" + curY, 10, 30);
                g.setColor(Color.RED);
                g.fillOval(ballX, ballY, ballW, ballH);
        public static void main(String[] asd)
            new Shoot();
    }

    public boolean isPointInCircle(){
        double x= circle.getWidth/2.0+circle.getX();
        double y= circle.getHeight/2.0+circle.getY();
        double distance=getDistance(x,y,pointX,PointY);
        return (distance<= circle.getWidth/2.0); //if the distance from the point to the center of the circle is less than the radius of the circle return true
    double getDistance(double x1, double y1, double x2, double y2){
        return math.sqrt((x1-x2)(x1-x2) + (y1-y2)(y1-y2));
    }Edited by: ghostbust555 on Jan 23, 2011 3:20 PM

  • I have a doubt?

    i'm doing the pitagoras theorem in java, to calculate one hipotenosa.
    but i don't know how to calculate the root square in java.
    do you know it?
    thanks

    Math.sqrt(number);

  • What am I doing wrong with this filter (counter/frequency issue), probably another newb question.

    I extracted the part of my VI that applies here.  I have a 6602 DAQ board reading a counter for frequency, using a Cherry Corp proximity sensor.  Getting a lot of noise and errant ridiculously high readings.  Speed of shaft which it's measuring is currently 2400rpm with one pulse per revolution so 40hz. 
    Trying to use the express filter VI to clean up the signal and ignore anything over, say, 45hz and under 35hz.  No matter what setting I choose I continually get the  20020 error, Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.  I know this relates to sample period somehow, but for the life of me I can't understand what I'm doing wrong. 
    I used this VI without filtering on bench tests with a hand-drill and got perfect output every time.  Now it's on the machine and being erratic.  Any help here will ease my stress level significantly, thanks.
    VI attached
    Still confused after 8 years.
    Attachments:
    RPM.vi ‏92 KB

    Hello Ralph,
    I'm not sure about mounting your sensor to your rig, but I can provide a couple ideas about the filtering. Depending on the type of noise, the digital filters on the PCI-6602 could help eliminate the behavior you are seeing. If the noise manifests as a "glitches" or a bouncing signal, you could use another counter with a minimum period to help eliminate the noise. This concept is discussed in greater detail in this KnowledgeBase. I noticed that you are using NI-DAQmx; the practical application of the digital filters on the PCI-6602 in NI-DAQmx is discussed in this KnowledgeBase. A more detailed description of the behavior of these filters is provided in the NI-DAQmx Help (Start>>All Programs>>National Instruments>>NI-DAQ) in the book entitled "Digital Filtering Considerations for TIO-Based Devices".
    I also wanted to comment on your original post and explain why you were receiving error -20020. For convenience, I have copied the text of the error code below.
    Error -20020 occurred at an unidentified location
    Possible reason(s):
    Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.
    I think you may have misunderstood exactly what the Filter express VI does. The Filter express VI takes a series of values in a waveform and performs filtering on those signals. So, it will look at a waveform made up of X and Y values and apply the defined filter to this waveform. Specifically in your application, the cut-off frequency (fc) is the Upper Cut-Off level that you specified in the Filter express VI; any frequency components of the waveform outside of the range you have defined will be filtered. The fs is the sample rate based on the data that you wire to the Signal input of the Filter express VI. In your VI, this data is coming from the DAQ Assistant. So, fs will be the sample rate of the DAQ Assistant and is associated with the rate at which points are acquired. The sample rate does NOT relate to the bandwidth of the signal, except that the Nyquist theorem tells us that the sample rate must be at least twice the signal bandwidth in order to determine periodicity of the signal. So, in this case, the sample rate of the DAQ Assistant would need to be at least double the high cut-off frequency.
    However, you are performing a frequency measurement using a counter. I think this is where the confusion comes in. For the frequency measurement using a counter, the DAQ Assistant returns a decimal value which represents the rate of the pulse train being measured by the counter. It does not return the actual waveform that is being read by the counter. It is this waveform that would be band-pass filtered to eliminate frequency content outside of the filter's bandwidth. Instead of the Filter express VI, I would recommend that you simply discard values that are outside the range you specify. I have modified the code you posted earlier to perform this operation. The image below shows the changes that I made; rather than using the Filter express VI, I simply compare the frequency to the "Low Threshold" and "High Threshold". I use a Case structure to display the value on if it is within the limits. Otherwise, I display a "NaN" value. I have also attached the modified VI to this post.
    Message Edited by Matt A on 09-04-2007 07:58 PM
    Matt Anderson
    Hardware Services Marketing Manager
    National Instruments
    Attachments:
    RPM (Modified).JPG ‏17 KB
    RPM (modified).vi ‏72 KB

  • Order Analysis Toolkit is acting peculiar

    Salutations,
    What we're experiencing isn't so much an error as a lack of expected behavior. The big picture is this: we want to generate Bode & Polar plots from proximity probe data recorded during the startup/shutdown of a turbine. The problem is that the data is too much to hold in memory at one time (5kHz sampling over ~15-20 minutes, but potentially much longer). There may be a flaw in the concept I used to create the software. I assumed that if I fed a chunk of data to the resampling vi and then to the order extraction vi I could take the resultant magnitude, phase, and RPM vectors and average them for the chunk of data (ideally 1 second) generating one point for the eventual magnitude and phase XY graphs. In this way, I would build a graph containing 1 point for each second of data that goes in. The assumption is that at a given RPM, the average magnitude and phase should be fairly constant.
    Currently, at high RPM values the we seem to be getting answers (are they correct, not entirely certain), however at lower RPM values the data set returns the NaN issue. This could be due to a lack in points being sent into the VI's, as the RPM increases the amount of data information from the tach sensor (over the 1 second) increases. While probing the data after Labview's OAT Resample Waveform, the dr value remains constant during the NaN section, however it becomes dynamic when the data starts to show answers. This all occurs prior to entering the OAT track orders in resample signal vi.
    Hence, we are uncertain if there are specific limitations to the vi's that aren't mentioned in the manual. Yes, I RTFM'd.
    Thank you for your time and assistance,
    E. Smith

    The other analysis information is coming along spectacularly. It's just when we attempt to do Bode plots that there is a problem.
    The minimum RPM is around 200. So, that is offering plenty of information. We've ensured the proper sampling by the Nyquist Theorem.
    The problem exists somewhere in the basic assumptions of the OAT toolkit Vi's that have been mentioned. I'm attempting to decipher why this exists, and what the exact limitations are.
    Thanks for the response,
    ElSmitho

  • Pythagorean triples complex squares

    While working on a math problem recently that involved Pythagorean Triples I spotted a connection with the complex numbers that I had never noticed previously. It is a trivial observation and I was surprised that in my many years as a mathematician I had never heard anyone mention this little fact. I am curious if this little fact is well known to others and I just happened to miss it or if it really is unknown to most folks.
    A Pythagorean triple is a set of three integers like 3,4,5 that make a right triangle with integer sides. Being a right triangle the numbers fit the Pythagorean theorem, a^2 + b^2 = c^2 and sho nuff 9 + 16 = 25
    Euclid has a proof that is presented in the Elements that all Pythagorean triples can be generated from two integers s, and t by means of these formulae
    a = 2st
    b = s^2 - t^2
    c = s^2 + t^2
    It is fairly easy to use algebra to square a and b using those formulae and see that these numbers do in fact form a Pythagorean triple. It is only slightly more difficult to go the other way and show that all triples are of this form.
    So all of this is ancient history - known to Euclid.
    Now let us take a complex number, c = a + bi. Let it be a complex integer, meaning that a and b are actually integers. Viewed from the complex plane, the complex number c represents a little right triangle, one leg is the real part, one leg is the imaginary part and the hypotenuse is the norm of the complex number c i.e.
    |c| = sqrt(a^2 + b^2)
    Clearly because of the square root sign the norm of c is not necessarily an integer and thus the triangle a,b,c is not necessarily a Pythagorean triple. However just square the complex number c
    (a + bi)*(a + bi) = (a^2 - b^2) + (2ab)i
    Notice anything about the form of a perfect square in the complex plane and Euclid's characterization of a Pythagorean triple? One leg is a difference of squares the other is twice the product of the two numbers.
    They are one and the same. The Pythagorean triples are just exactly the perfect squares in the complex plane.
    So for example (2 + i) is not a square and is not a Pythagorean triple. Its norm is sqrt(5). but if you square it, you get (3 + 4i) whose norm is 5.
    That is the observation. Nothing difficult. Perfectly obvious. Every mathematician from Euclid on knows about right triangles and everyone since Gauss has been able to multiply two complex integers. It is about as easy as math gets. I was astonished that in years as a working mathematician I had never noticed this nor heard anyone mention this simple fact.
    Yes, I know - you're thinking that the reason this never came up in conversation is because this observation is totally irrelevant and practically useless, but that has never stopped mathematics. Just ask any mathematician to tell you about paracompact Hausdorff spaces and listen to an amazing tirade of irrelevant and practically useless information.
    The Pythagorean triples are just the perfect squares in the complex plane.
    Just for grins Google 'Pythagorean triples "complex squares"' to see a Google search that returns but a single result. Hole in one. except that it is not about the result that I just mentioned.
    I make no claim that any of this is original, I am only flabbergasted at my ignorance and am casting out to see if I was just asleep the day they covered this in high school or if this really is a rather obscure and little known even if trivial observation.
    There is nothing left to say but to ask the survey questions
    1) Did you know this before you read it here?
    2) If you did know it, was it shown to you or did you discover it yourself?
    Enjoy!

    You are so correct Jos, you can have a common prime root in the legs. Euclid's formula was for the primitive triples.
    I had run into a triple in a problem that I was playing with, remembered that there was a characterization in Euclid and while skimming it noticed that it looked exactly like a squared complex number. This would explain the lack of finding this fact noted on the various math sites - the mere fact that it isn't really true.
    The connection to the complex plane is real but as you say the complex squares are the pirmitive triples not all of them.
    Of course, if I were a good mathematician I would pretend that I knew that all along and in a disgusted tone utter, "Do you take me for some kind of fool? Obviously I meant 'primitive' because it isn't true otherwise."
    These days I am closer to fool than to a good mathematician.
    I am very glad that you pointed this out. The problem I was working on required triples and I was about to limit my considerations to just the primitive ones when in fact a non-primitive one could do.
    Domo arigato gozaimashita!

  • 6602 as X4 encoder/ex​ternal clock

    Hello,
    Im trying to use a PCI 6602 to read the output of a linear encoder.  I have a few (I think simple) questions about setting things up...
    Right now I am only using CTR 0 (channel A hooked up to pin 2, B to 40, and Z to 3).  I have been trying to use the DAQ assistant to set up the code.  When i change the acquisition mode to continuous, it asks me to specify a clock type and source.  The only option I am given for clock type is external (is this right?), and for source I have options like PFIxx or RTSxx.  None of these source options seem to allow me to acquire data in continuous mode (The "test" routine doesn't read back anything).  Any suggestions on what I should be doing differently?  Don't feel bad about "dumbing down" your reply :-)  Any info is useful, I'm pretty new to Labview...
    Thanks

    I don't have an LV machine available near my network PC and have only been able to look at the screenshots.  To be perfectly frank, I see far too many issues to address and tutor individually with the limited time I have.  As friendly advice, I would *strongly* recommend backing up several steps and first make an app that works with 1 encoder.  Once you get through that part of the learning curve, *then* add the other encoder channels to your app.  Then my prior post about DMA and interrupts will become relevant again.
    Other things:
    1. I really, *really*, think you've got the wrong idea about how the counters measure encoder signals.  You do NOT need to sample at 2x the encoder pulse rate, the Nyquist theorem does NOT apply here.  The hardware count register tracks encoder position accurately with your 400 kHz encoder signals.  Your app is free to choose how often to sample that count register according to your needs.  This may be anywhere from 1 Hz or less to several kHz.  It does NOT need to approach 1 MHz and even if you tried, the system is almost certain to be incapable of such a rate.
    2. After all the talk about sampling at 1 MHz, you have a software loop that reads 1 single value at a time from each encoder and has a timer to run it only once every 10 msec.  There is a *very* fundamental disconnect here.  (It also appears that you have optional file writes inside the same loop, another factor that'll slow you down.)
    3. The encoder readings are not hardware-sync'ed in time -- the first value read from each represents their positions at different points in time.  With such high-precision encoders, I'd think you would need hardware sync on the read times.
    Finally, why not give us an overall description of your app's needs?  Kind of a big picture description.  I know you've told us what you think the problems are, but I'd wager my NI screwdriver that the 1 MHz sampling rate you think is your main problem will turn out not to be relevant. 
    -Kevin P.
    I don't have an LV machine available near my network PC and have only been able to look at the screenshots.  To be perfectly frank, I see far too many issues to address and tutor individually with the limited time I have.  As friendly advice, I would *strongly* recommend backing up several steps and first make an app that works with 1 encoder.  Once you get through that part of the learning curve, *then* add the other encoder channels to your app.  Then my prior post about DMA and interrupts will become relevant again.
    Other things:
    1. I really, *really*, think you've got the wrong idea about how the counters measure encoder signals.  You do NOT need to sample at 2x the encoder pulse rate, the Nyquist theorem does NOT apply here.  The hardware count register tracks encoder position accurately with your 400 kHz encoder signals.  Your app is free to choose how often to sample that count register according to your needs.  This may be anywhere from 1 Hz or less to several kHz.  It does NOT need to approach 1 MHz and even if you tried, the system is almost certain to be incapable of such a rate.
    2. After all the talk about sampling at 1 MHz, you have a software loop that reads 1 single value at a time from each encoder and has a timer to run it only once every 10 msec.  There is a *very* fundamental disconnect here.  (It also appears that you have optional file writes inside the same loop, another factor that'll slow you down.)
    3. The encoder readings are not hardware-sync'ed in time -- the first value read from each represents their positions at different points in time.  With such high-precision encoders, I'd think you would need hardware sync on the read times.
    Finally, why not give us an overall description of your app's needs?  Kind of a big picture description.  I know you've told us what you think the problems are, but I'd wager my NI screwdriver that the 1 MHz sampling rate you think is your main problem will turn out not to be relevant. 
    -Kevin P.

  • New iMac Display Sizes

    I'm ready to buy one of the new iMac models but when looking at the current 20", 24" monitors, I think the 24" is the largest I can comfortable accommodate on my desk.
    I note that the newly released iMac is available as a 21.5" or a 27" in a 16:9 ratio. What was the old ratio, or better yet, is the viewable screen size of a new 27" the same as the old 24" or is it larger?
    If the new sizes equal the viewable sizes of the old iMac screens then I can accommodate a 27" model on my desk. If it is larger, I'll have to get a 21.5".
    Thanks
    kayjh

    Again, the important thing is pixel count. A 50-inch HDTV may have a physically larger display, but it only has 1920x1080 pixels (the same as the 21.5-inch new iMac). Larger pixels does not let you do more with your computer, MORE pixels does.
    You can figure out the pixel density this way. Using the [Pythagorean theorem|http://en.wikipedia.org/wiki/Pythagorean_theorem],
    !http://upload.wikimedia.org/math/1/4/5/1455314a78f39a594485adbaf74d63f9.png!
    figure out how many pixels go along th diagonal. You know a (2560) and b (1440), so you can figure out c. I get 2937 pixels along the diagonal. That diagonal is 27 inches, so the pixel density (pixels per inch) is 2937 divided by 27, or about 109 ppi.
    For the 24-inch display, using the same math, it is only about 94 ppi.
    So objects on the new display will look about 10% smaller than they would look on the old display. The new display will also look more sharp for the same reason. And as I mentioned above, the new display has 60% more pixels to work with compared to the old display.

  • Problems with displaying high frequency sine wave

    Hi all,
    I don't why LabVIEW has problem with high frequency display.
    Someone plzzz explane me how to see a better grapth on grapth?
    check this function waveform generation.vi in examples go to search and type "waveform"
    set the feq to 1k.
    Thanks and regards

    I think that this is related to LabVIEW, but more basically to the Shannon theorem : if you want to describe a periodic function, you need to take enough samples. First, expand the x scale to see a delta t of 0.001 s (ie a period of your 1000 Hz signal). Remeber to set the autoscale property on OFF. Then go to "sampling info" and increase the sampling frequency. See the result...
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for