Making a zone plate in C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pieter

    Making a zone plate in C++

    Hi,

    I'm currently making a basic pattern generator. When you open the
    program it draws the selected pattern in a box, you can make the box
    also bigger and smaller just by dragging at the corners.
    So I also want to implent a zone plate, but I can't get it to work.
    Already found following formula: phi = (k*phi) + (kx*x) + (ky*y) +
    (kt*t), the last section with kt*t I will not use that.
    So I started really simple and just implemted the section with x and
    cam to the following formula:
    double MaxFreq = 1;
    double MinFreq = 0.1;
    double step = (MaxFreq - MinFreq)/ (Box.right/2);
    double minstep = MinFreq;

    q = (((x*minstep)-(127.5))/(127.5));
    z = 127.5 + (sin(pi*q)*127. 5);
    The minstep is the step between two x's, in this way it is possible to
    go from one frequency to an other.
    But in my opion there is something wrong with this formula, because
    there's now relation between the numbers that I enter for the begin
    and end frequency.
    Hope that you understand a bit of what I'm doing or maybe I totolly
    wrong and is this not the right method to make a zone plate. Is there
    somebody who already made a zone plate in C++ and maybe want to share
    it with me or give me some instruction?

    Thanks a lot already
    Pieter

    PS: Sorry if my english is not always correct or did some misspelling.
  • lbonafide@yahoo.com

    #2
    Re: Making a zone plate in C++

    On Apr 1, 9:04 am, Pieter <pieter.huy...@ gmail.comwrote:

    <snip>
    >
    PS: Sorry if my english is not always correct or did some misspelling.
    Your English is fine, I just have no idea what a zone plate is. Maybe
    someone else here will, but you may be better asking in a forum or
    group dedicated to your field.

    Comment

    • Pieter

      #3
      Re: Making a zone plate in C++

      On 1 apr, 16:17, lbonaf...@yahoo .com wrote:
      On Apr 1, 9:04 am, Pieter <pieter.huy...@ gmail.comwrote:
      >
      <snip>
      >
      >
      >
      PS: Sorry if my english is not always correct or did some misspelling.
      >
      Your English is fine, I just have no idea what a zone plate is.  Maybe
      someone else here will, but you may be better asking in a forum or
      group dedicated to your field.
      Hi, thx for the quick response.
      I already searched the web for some information, but the most is going
      over the use of zone plate in optics. I found a pdf wich gives you a
      very good impression of what a zone plate is and also a the end there
      is a program which can create zone plates, but if you look at the
      figures in the pdf you'll have a good impression of what a zone plate
      is. The one I want to build can be found at page 10.
      Link: http://www.omnitek.tv/admin/old_supp...V01%5B1%5D.pdf
      And indeed, maybe I should search for an other forum, but it's really
      hard to find one.

      Greets
      Pieter

      Comment

      • Richard Herring

        #4
        Re: Making a zone plate in C++

        In message
        <bf5efa75-3b67-4bdd-bb65-72d0046cf234@e1 0g2000prf.googl egroups.com>,
        Pieter <pieter.huyghe@ gmail.comwrites
        >On 1 apr, 16:17, lbonaf...@yahoo .com wrote:
        >On Apr 1, 9:04 am, Pieter <pieter.huy...@ gmail.comwrote:
        >>
        ><snip>
        >>
        >>
        >>
        PS: Sorry if my english is not always correct or did some misspelling.
        >>
        >Your English is fine, I just have no idea what a zone plate is.  Maybe
        >someone else here will, but you may be better asking in a forum or
        >group dedicated to your field.
        >
        >Hi, thx for the quick response.
        >I already searched the web for some information, but the most is going
        >over the use of zone plate in optics. I found a pdf wich gives you a
        >very good impression of what a zone plate is and also a the end there
        >is a program which can create zone plates, but if you look at the
        >figures in the pdf you'll have a good impression of what a zone plate
        >is. The one I want to build can be found at page 10.
        >Link:
        >http://www.omnitek.tv/admin/old_supp...r_2_Zone_Plate
        >_Generator_V01 %5B1%5D.pdf
        >And indeed, maybe I should search for an other forum, but it's really
        >hard to find one.
        You asked about doing this, whatever it is, "in C++", but that
        qualification appears to be irrelevant, as the code you posted was basic
        floating-point arithmetic which wouldn't be substantively different in
        Fortran, Java or Visual Basic. That really does suggest that you've
        picked the wrong group to ask this question. Possibly somewhere in
        comp.graphics.* (e.g. algorithms?) would be more appropriate?


        --
        Richard Herring

        Comment

        • Pieter

          #5
          Re: Making a zone plate in C++

          On 1 apr, 17:32, Richard Herring <junk@[127.0.0.1]wrote:
          In message
          <bf5efa75-3b67-4bdd-bb65-72d0046cf...@e1 0g2000prf.googl egroups.com>,
          Pieter <pieter.huy...@ gmail.comwrites
          >
          >
          >
          On 1 apr, 16:17, lbonaf...@yahoo .com wrote:
          On Apr 1, 9:04 am, Pieter <pieter.huy...@ gmail.comwrote:
          >
          <snip>
          >
          PS: Sorry if my english is not always correct or did some misspelling..
          >
          Your English is fine, I just have no idea what a zone plate is.  Maybe
          someone else here will, but you may be better asking in a forum or
          group dedicated to your field.
          >
          Hi, thx for the quick response.
          I already searched the web for some information, but the most is going
          over the use of zone plate in optics. I found a pdf wich gives you a
          very good impression of what a zone plate is and also a the end there
          is a program which can create zone plates, but if you look at the
          figures in the pdf you'll have a good impression of what a zone plate
          is. The one I want to build can be found at page 10.
          Link:

          _Generator_V01% 5B1%5D.pdf
          And indeed, maybe I should search for an other forum, but it's really
          hard to find one.
          >
          You asked about doing this, whatever it is, "in C++", but that
          qualification appears to be irrelevant, as the code you posted was basic
          floating-point arithmetic which wouldn't be substantively different in
          Fortran, Java or Visual Basic. That really does suggest that you've
          picked the wrong group to ask this question. Possibly somewhere in
          comp.graphics.* (e.g. algorithms?) would be more appropriate?
          >
          --
          Richard Herring
          Sorry that I asked the question, just thought it was in the correct
          group. I'am so familiar with all these groups and will follow the
          given advise, I will ask my question in an other group.

          Thanks for the replies.
          Pieter

          Comment

          Working...