Complicated easy question - ray tracing

Hello,
i am working currently on one project - i have an optical system (some prisms, some lenses etc) and i want to make a VI to calculate propagation of a light ray - something like ray tracing.
I know that labview is not the perfect platform to deal with this issue, however i still would like to try.
My problem is as following: i want to calculate the propagation of a ray through a lens. I have the ray with some coordinate (y=const) and a plano convex lens - the front of a lens is a piece of a sphere. To calculate the propagation (using snell law) I have to find an angle between the ray and the line which is tangent to this lens-sphere in the point where my light beam hits the lens.
My procedure (on the piece of paper):
1.i know the coordinates of a center of a sphere (let's take (0,0)) and its radius r (x^2+y^2=r^2). I know the value of y=y_0 for which the ray enters the lens.
then i can calculate the x_0: x_0^2+y_0^2=r^2. Now i know the point where light enters the lens (x_0,y_0)
2.then just the usual procedure of finding equation for a line tangent to sphere (y=a*x+b):
i put y_0 and x_0 to this equation:
y_0=a*x_0+b
and i can remove one unknown value (for example b): y=a*(x-y_0)+x_0
3.then i put such equation into the equation for sphere (x^2+y^2=r^2) and this is the quadratic equation which has only one unknown value x and one free parameter: a.
4.beacause i want to have tangent line, so it should have only one common point with sphere - so the quadratic equation should have determinant equal to zero (only one solution for x). This gives me an equation for a. I should find the value of a which satisfy this equation and then i know this tangent line and have the solution! uf....
Unfortunately i still didn't find a solution to implement this in labview (and i'm motivated beacuse most of the work for this project is already done). I was trying with the formula parsing and so on, but i didn't succeeded. 
I will be really grateful for any hints or help!
Solved!
Go to Solution.

helmik,
LabVIEW does not do symbolic math.  Once you have the equations solved on paper or reduced to a set which can be solved numerically, tehn you can program it in LV.
When I look at your math in the first post, I see that in (3) you describe an equation in x and a. However, this is not a quadratic equation but a fourth order polynomial with terms like a^2*x^2 and 2*a^2*x*y_0. So this is not so easily solved.
Is not the tangent to the sphere at right angles to the radius at that point? The angle of the radius can be calculated from x_0 and y_0 and the center of the sphere. Then add 90 degrees. One arctangent and no complicated equations.
Lynn

Similar Messages

  • Ray Tracing question

    Hi all,
    In Java2D the tracing algorithm can handle effectively primitive shapes, like cubes, spheres etc, mapping the shapes from 3D to 2D. So we can, for example, rotate the whole "scene" and have a 3D illusion of the world. But what about images? The ray tracing algorithm uses the 3D coordinates system, so how can we handle the 2D representation of an image? I know that in Java3D there are special Loaders that load a description of an image and tranform it appropriately in the 3D world. Is there any way to have a 3D representation of an image in Java2D?
    Thanks

    helmik,
    LabVIEW does not do symbolic math.  Once you have the equations solved on paper or reduced to a set which can be solved numerically, tehn you can program it in LV.
    When I look at your math in the first post, I see that in (3) you describe an equation in x and a. However, this is not a quadratic equation but a fourth order polynomial with terms like a^2*x^2 and 2*a^2*x*y_0. So this is not so easily solved.
    Is not the tangent to the sphere at right angles to the radius at that point? The angle of the radius can be calculated from x_0 and y_0 and the center of the sphere. Then add 90 degrees. One arctangent and no complicated equations.
    Lynn

  • Ray tracing fault won't allow me to use AE

    Hi guys,
    I just downloaded the trial version of AE from the Adobe website. But when I open it, I recieve an error saying that
    ray-tracing on the GPU requires an approved NVIDIA graphics card. I read all the other discussions, but I cannot
    change anything because AE closes itselfs. Where can I fix the problem ?

    FAQ: What information should I provide when asking a question on this forum?
    We don't even know what version of AE you downloaded or what OS you're using.

  • Ray tracing not working

    I get the 'Out of paged mapped memory' when I try to make 3D titles.
    IMac 2011 - the 6970 graphics card - 16Gb RAM
    Could this be yet another incompatibility between CS6 and the 2011 Imac (ie. the 6970 card which Adobe refuse to support)?
    Thanks in anticipation of a fix!!

    Hi Todd,,
    When I try to change the Renderer pull down top right of the composition window to Ray-Traced 3D, the composition settings window opens on the Advanced tab and when I change the Renderer pull down to Ray-Traced I get the following error message in a window headed (5070::0):
    After Effects error: Ray-traced 3D: Out of paged mapped memory for ray tracer. (5070::0)
    Screen shot attached.
    To answer those questions:
    version: 11.0.1.12
    OSX 10.7.5
    ProRes 422(HQ) 1920 x 1080 23.98fps
    I am trying to make a title that I have applied via 'Track Camera' into a 3D one. This has never worked.
    Other software running is Premiere CS6
    No 3rd party effects
    2011 Imac 3.4GHz i7, 16Gb RAM, 6970 Graphics card, 4 core. One 6Tb Thunderbolt hard drive connected (although working of internal drives at this time)
    No 3rd party I/O stuff
    Not using Render Multiple frames ......

  • AE CS6, ray tracing with K2100M on a precision M4800

    Hello,
    I work with after effects CS6, using a mobile workstation precision M4800 with QuadHD Display and a quadro card K2100M
    The K200M GPU is supported for the acceleration of the ray-traced renderer, in K2100M I'm not sure.
    in settings I get the following message:
    GPU unavailable, incompatible devices or display driver.
    I have installed the latest WHQL driver.
    or do I need a special Cuda driver from nvidia like this one:
    CUDA Downloads
    The QHD display + of this precision is great and the i7-4930MX is strong enough, but ray tracing with GPU should be better.
    Can someone help me?
    I'm disappointed because I thought ray tracing with GPU works with a K2100M quadro card.
    The K2100M is much faster than the K2000M and should work.
    Best regards from Germany, Götz

    Thank you very much!
    "then you must install the CUDA driver. Simple as that."..........
    I have the cuda driver already downloaded for windows 8.1
    I have just reread this again, but I was not sure.
    It's really easy when you get so a quick response from someone like you.
    Tomorrow I will install the driver, but now I have to look at football,
    Germany-Brazil
    have a nice day

  • Effects Don't work with Ray-Traced 3D?

    Hello,
    I'm working on a 3D logo for a company, and I'm trying to snaz what I have done with some effects, but the effects don't work. For example, I tried adding the CC Light Wipe Effect, but it will only show up when I switch back to the classic 3D renderer. Google searches aren't exaclty effective when I my serach quiere has "Effects" and After Effects" in it, so I'm forced to come here looking for the answer.
    Are effects supported in this new renderer? If so, how do I get them to work?
    Thanks

    Pre-composing and then switching off Ray-traced rendering in the main comp gives you the ability to apply effects to the pre-comp. This may or may not work for your situation.
    Another option is to pre-render your Ray-traced work and then apply effects to the footage. There's almost always something you can do if you think about it for a while.
    Still another option is to put a 2D adjustment layer above your 3D Ray-traced layer and apply the effect there.

  • Easy Question: Illegal Start of Expression

    This is a ridiculously easy question... but I am having trouble with it...
    Anyway, here is the line of code that is giving me trouble:
    jButtons = {{jButton1, jButton5, jButton9, jButton13},
    {jButton2, jButton6, jButton10, jButton14},
    {jButton3, jButton7, jButton11, jButton15},
    {jButton4, jButton8, jButton12, jButton16}};
            That's it. jButton1 through jButton16 are all jButton objects (for a GUI). jButtons is an array (4 by 4) of jButton. All are global variables, the buttons are all initilized (in fact, that was the problem I had before, and why I need to put this here: otherwise I get a null pointer exception).
    Surprisingly, such a simple line of code causes TONS of errors to occur. To save space, {...} * 2 means that the exception occurs twice in a row, errors are separated by comma's.
    { Illegal Start of Expression, {Not a statement, ; required} * 2} * 4, Empty statement
    A similar statement (int[] test = {{1,2,3},{4,5,6}};) works perfectly fine.
    Please help, doing this will reduce the size of my code to about a third of the size of the code. And then I can laugh in the faces of those people who say that I write long, and in-efficient code! MWHAHAHAHAHAHA!!
    However, I will keep at it, and Murphy's Law states I will find a solution 10 seconds after posting. If I do, I will edit this post, and tell you guys the answer ;)
    [Edit]In case you are wondering... all my other code is correct. Here is the adjacent 3 methods:
    private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {
        ButtonClick(3,3);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton10;
        private javax.swing.JButton jButton11;
        private javax.swing.JButton jButton12;
        private javax.swing.JButton jButton13;
        private javax.swing.JButton jButton14;
        private javax.swing.JButton jButton15;
        private javax.swing.JButton jButton16;
        private javax.swing.JButton jButton17;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JButton jButton5;
        private javax.swing.JButton jButton6;
        private javax.swing.JButton jButton7;
        private javax.swing.JButton jButton8;
        private javax.swing.JButton jButton9;
        private javax.swing.JLabel jLabel1;
        // End of variables declaration
         * @param args the command line arguments
        public static void main(String args[])
            jButtons = {{jButton1, jButton5, jButton9, jButton13},
    {jButton2, jButton6, jButton10, jButton14},
    {jButton3, jButton7, jButton11, jButton15},
    {jButton4, jButton8, jButton12, jButton16}};
            int[][] test = {{1,2,3},{4,5,6}};
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new GameWindow().setVisible(true);               
        String[] row1 = {"1", "5", "9", "13"};
        String[] row2 = {"2", "6", "10", "14"};
        String[] row3 = {"3", "7", "11", "15"};
        String[] row4 = {"4", "8", "12", ""};
        String[][] labels = {row1, row2, row3, row4};
        int blankX = 3;
        int blankY = 3;
        static javax.swing.JButton[][] jButtons;
        private void DisableAll()
            for (int looperX = 0; looperX < 4; looperX++)
                for (int looperY = 0; looperY < 4; looperY++)
                    jButtons[looperX][looperY].setEnabled(false); 
        Edited by: circularSquare on Oct 13, 2008 5:49 PM
    Edited by: circularSquare on Oct 13, 2008 5:52 PM

    You can only initialise an array like that when you declare it at the same time. Otherwise you have to do as suggested above.
    int[] numbers = {1,2,3,4}; //ok
    int[] numbers;
    numbers = {1,2,3,4}; // not ok

  • Easy question - how to increase number of recent files in menu?

    This is for CS5 if it matters.
    I'm an infrequent Illustrator user (at best) but I have what I hope is an easy question: I want to increase number of recent files showing in the menu.
    I can't find a preferece to set such as in PS and almost every other application on the face of the earth. I've tried to reset the preferences file (start Illustrator with ctrl-alt-shift held down) but I'm stuck at 4 files, which I assume is the anemic default option.
    Is there an easy way to do this that Adobe has hidded somewhere? As expected, it can't be found in the help, I can't find it on the forums, or even on the net, but I do know it can be done because I can see other installs showing lots of files in the list.
    thanks for any help.

    This might be because of a new feature that you can turn off for each object, and alltogether. When you create a new document at the bottom, make sure 'Align New Objects to Pixel Grid' is unchecked.  After you have created a new file, you can still go into the 'TRANSFORM' palette (SHIFT+8), use the little right top menu, and make sure 'Align New Objects to Pixel Grid' is unchecked. And if you want to get fancy with each object; you can select an object, and look at the 'TRANSFORM' palette at the bottom is a place to uncheck the 'Align to Pixel Grid' at your disposall.
    Before I found this, it ruined my week.
    http://www.kenwells.com

  • Easy question I'm sure. imac hard full (500gb) mostly from iphoto. no capacity left. what are my options? I've thought of an external drive of 1tb and then a 2nd external drive of 3tb to back up both???? please help.

    easy question I'm sure. imac hard full (500gb) mostly from iphoto. no capacity left. what are my options? I've thought of an external drive of 1tb and then a 2nd external drive of 3tb to back up both???? please help.

    Those are the options - more space is more space.
    Moving the iPhoto Library is simple:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • Problem with noise/artefacts in AE6 Ray Traced mode.

    I'm having a problem with some kind or weird artefacts appearing on parts of an imported Illustrator layer. Here's the import procedure I'm using:
    In AE6 I switch to Ray Traced 3D mode, then I make a new comp, add a camera, import my Illustrator file, drag it into the comp. Then I right-click on the Illustrator file in the comp and and select "create shapes from vector layer" then make the layer 3D. I can extrude etc. but for the sake of this post, I didn't do that. I get the artefact regardless.
    Here's a cropped portion of my Illustrator file showing the problem:
    http://img99.imageshack.us/img99/74/linesc.jpg
    Here's another screen-cap showing the problem from a different angle:
    http://img717.imageshack.us/img717/4757/lines2.jpg
    The sample image is in full res and set to AE's "final quality" mode.
    I've tried different setting for the render quality (the same image is set to 10), but it seem the higher the quality I set it to, the more obvious the artefacts become!
    I've added no lighting or anything else to the scene, jut the camera and the AI file. I've also inspected the Illustrator file inside Illustrator and I cannot see anything at all that can be causing this problem. Is it perhaps an export setting problem in AI?
    These lines only appear when I use the "create shapes from vector layer" option.

    Thank you very much for your reply.
    Could you please explain to me how to import the paths in the manner you describe? I'm not overly familiar with Illustrator, other than loading and saving artwork.
    If it's any help, here is the Illustrator file as supplied to me: homepage.ntlworld.com/mike1962/cnet.ai
    Thanks,
    Mike.

  • Anyone know if After Effects supports the Navida GTX750 graphics card for ray-tracing?

    Anyone know if After Effects supports the Navida GTX750 graphics card for ray-tracing?

    All GPUs supported for GPU acceleration of the ray-traced 3D renderer are listed in the system requirements:
    System requirements | After Effects

  • Why does my font/text change when I switch from Classic 3D to Ray traced 3D in After Effects?

    My font/text changes when I switch from Classic 3D to Ray traced 3D. Why is it doing this? Also, I cant get the font/txt to look the same after I switch from Classic to Ray traced. How can I get it to look the same?

    I am pretty new to After Effects so I hope it's not my inexperience that's causing the problem. (It probably is)
    I just updated to the most current version of AE.
    I am on a mac pro late 2013 12GB 6 core. Running OSX 10.9.4
    Okay so after looking at it a little closer, I think the color is what mostly changes. The first screenshot is the what the text look like with Classic 3D and the second screenshot is what it looks like after I change it to Ray traced 3D. Also under the "Mode" section..the pull down that says "Normal" disappears. I'm wondering why the font color is changing?

  • Making a Ray-Traced image expand

    Running CS6 on Mac OS.  I was wondering if you could do something like a stroke reveal effect like you would for a fake handwriting effect work on an extruded image.  Like if I had an extruded Q, could I make it "grow" in a circle if I'm usuing Ray-Traced (which I know is rather limited).  I'm open to any suggestions.  I'm not getting my hopes up on this one but I'm hoping someone might have a creative idea at least how to cheat and get some kind of similar effect.

    The raytracer responds to animation in extruded shape layers, which can include any Merge Paths operations like subtracting stuff from shapes with otehr shapes and animate the cutting object to create a reveal...
    Mylenium

  • Gt645m not supported for ray tracing?

    Hello guys recently i bought a laptop with 645m GPU its MSI c61 was having 2nd thought of buying the other laptop which has 650m because of $250 difference and when searched for the both GPU specs its almos the same so i just bought gt645m instead and use the $250 on SSD but my gawd now i am in deep trouble.. because gt 645m is not supported by after effects and in this site it says this video card is OEM..
    http://www.studio1productions.com/Articles/AfterEffects.htm
    when i go to preferences on AE cs6 the GPU is greyed and wont let me choose it so its CPU in default. sadly i cant return it now cause i already bought the ssd and have no budget at all
    Is there anyway that i can use this card? for AE and Ppro? geezuz cries..

    ok i did that..
    and so i got this error
    After Effects error: Ray-traced 3d: Initial shader compile failed. (5070 :: 0)
    and when i removed my card from the list the error is gone . and GPU is not supported again .. of course

  • When support After Effects Ray-traced 3D the GPU of the new iMac with retina display (GPU: AMD Radeon R9 M295X 4GB)?

    I would like to know whether After Effects CC Ray-traced 3D support the GPU of the new iMac with retina display.

    It never will. This is nVidia-exclusive technology and the whole things is deprecated, anyway. You better learn to use Cineware, buy a 3D program like Pro Animator or Element 3D or learn a proper 3D program.
    Mylenium

Maybe you are looking for

  • Move photo in album, view returns to select location

    iPhoto '09  v8.1.1 424 (earlier versions, too) Organizing/moving photos in an album: When dragging a photo(s) in an album, say to move it from row 20 to row 1, where drag requires an auto scroll by holding the thumbnail at the top edge of album windo

  • Business area creation in command line

    Dear Pals, My discoverer version is Discoverer Version:Server 10.1.2.55.26 with EBS r12.0.4. I created EUL using eulapi and given SYSADMIN full access on the same. I've also imported Discoverer loader files. Now it is possible to create a Business ar

  • Create an infotype for Training and Events

    Hello SAP HCM Community, Does anyone have a step-by-step procedure on how to create an infotype for Training and Events (specifically for External Persons - H)? I also need to find out how do I edit an existing Training and Events or PD infotype, i.e

  • Memphis M-class 10" sub problems

    I recently purchased these Memphis M-class four ohm, dual voice coil subs. Everything was working fine, They take up to 300 watts each, and im pushing it with a 500 watt rockford fosgate amp. One day, my subs just stopped working in the middle of a s

  • COGS BU not refresh base on BU in AR Invoice row

    Hi!      When i choose one item and filled in BU in Ar invoice by row at the same time COGS BU also refresh and get value Of BU. After, i would like to change BU again but COGS BU not catch the value of BU like the first time. and then i create a que