Page 2 of 2 FirstFirst 12
Results 26 to 38 of 38

Thread: Axis problem in oblique cross-cylinder calculation

  1. #26
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    8. SPH(rx) = SumSE – CYL(rx)/2 (subtracting the cylinder/2 out of the spherical equivalent gives the the sphere)
    Thanks MakeOptics, I just accidentally droped that part.
    9. AX(rx) = Arctan(SumC045/SumC000)/2 (this is the axis not to be added to the axis)
    If SumC000<0 Axis+90 (arctan only returns values from -pi/2 to pi/2 which is well within the normal bounds of a prescription except on the negative scale in which case since we divided by 2 we can add 90 only if the value is negative, every other value is valid)
    I have reserve about your way to find axis, simply it returns results which is not the same with other sources/methods. For example, for next case:
    L1: 0.00=-10.00 ax88
    L2: 0.00=-2.00 ax0
    your way to finding axis return value -2.00=-8.01 ax178
    I compare calculation described by Lensgrinder, Crossed cyl calculator on OptiCampus and way to find axis what I was described. All these three clculations gives the same results: -2.00=-8.01 ax88.
    So, I would rather to stay on my method to calculate axis, because it gives the same results as calculator on OptiCampus and method described by Lensgrinder.
    Some useful information I found here, maybe it helps.
    https://sites.google.com/site/algebr...ar-coordinates

  2. #27
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    I need to look at the books again, I thought I had that down, I have an error somewhere yes you are correct the axis should be closer to the 88 then the 178 due to the higher power having the most influence.

    Yes vector's are what these formulas represent, good resource.
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  3. #28
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Yet another method:

    Convert the prescription into a power matrix and add them together then convert them back.



    I will find the decomposition method again and check out where the error is, I am probably not remembering it correctly, which means time for a refresher.

    Looks like the formula in my book has an error in it. I don't have the correct version of astigmatic decomposition anymore. I gave away my copy of a great book and my new book has a clear typo and both ways with and without the typo in the example are wrong. That's funny I had it memorized for so long that when I went to reference now I have a gap in knowledge. I was able to whip something up with the above formula that works well but it's in javascript which is easier for me then excel.

    JSFiddle: http://jsfiddle.net/harrychiling/dx0vefop/
    Last edited by MakeOptics; 08-18-2015 at 04:16 PM.
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  4. #29
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Working backwards with a known good formula I have derived the components and they work:



    Sum all the components and then decompose.
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  5. #30
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    Still problem with axis. Try with
    L1: 0.00=10.00 ax155
    L2: 0.00=-2.00 ax0

    If I was correctly applied your formula in previous post (#29), I can't get comparable result about axis. Your formula give me +8,42=-8,85 ax120, but it should be ax60.Your approach telling me that you want to solve axis with one formula withouth any if statement. But, because we deal with polar circle, there is 4 quadrants, and for 4 quadrants you need different 4 if statements how to do calculation for every particular case. Lensgrinder also showed that we must consider what quadrant is about. Combination of positive or negative value of x and y give us that feedback (in arctan(y/x)). Consider SumC000 as X value, and SumC045 as Y value which telling us what are xy-coordinates, and that is the key.
    I quadrant: +x,+y
    II quadrant: -x,+y
    III quadrant: -x,-y
    IV quadrant: +x,-y
    (look internet page with my link in post #26).

    Also look here: http://www.opticampus.com/files/intr...mic_optics.pdf page 116 and especialy page 117, on the top.
    Last edited by Wlada; 08-19-2015 at 06:26 PM.

  6. #31
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote Originally Posted by Wlada View Post
    Still problem with axis. Try with
    L1: 0.00=10.00 ax155
    L2: 0.00=-2.00 ax0

    If I was correctly applied your formula in previous post (#29), I can't get comparable result about axis. Your formula give me +8,42=-8,85 ax120, but it should be ax60.Your approach telling me that you want to solve axis with one formula withouth any if statement. But, because we deal with polar circle, there is 4 quadrants, and for 4 quadrants you need different 4 if statements how to do calculation for every particular case. Lensgrinder also showed that we must consider what quadrant is about. Combination of positive or negative value of x and y give us that feedback (in arctan(y/x)). Consider SumC000 as X value, and SumC045 as Y value which telling us what are xy-coordinates, and that is the key.
    I quadrant: +x,+y
    II quadrant: -x,+y
    III quadrant: -x,-y
    IV quadrant: +x,-y
    (look internet page with my link in post #26).

    Also look here: http://www.opticampus.com/files/intr...mic_optics.pdf page 116 and especialy page 117, on the top.
    Yes, I know the commonly available formula's but there is a method to remove the if statements. I think I have found it, the original formula substituting ATAN(C045/C000) with ATAN2(C045,C000), this changes the constrints from -pi/2 to pi/2 to pi to -pi. Then the only if statement necessary is the one to check if it is a negative value which would then have 180 applied to it.

    Sorry for the many post and different formula's but I am trying to rework the formula to program easier, that is my goal.
    Attached Files Attached Files
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  7. #32
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote Originally Posted by Wlada View Post
    Still problem with axis. Try with
    L1: 0.00=10.00 ax155
    L2: 0.00=-2.00 ax0

    If I was correctly applied your formula in previous post (#29), I can't get comparable result about axis. Your formula give me +8,42=-8,85 ax120, but it should be ax60.Your approach telling me that you want to solve axis with one formula withouth any if statement. But, because we deal with polar circle, there is 4 quadrants, and for 4 quadrants you need different 4 if statements how to do calculation for every particular case. Lensgrinder also showed that we must consider what quadrant is about. Combination of positive or negative value of x and y give us that feedback (in arctan(y/x)). Consider SumC000 as X value, and SumC045 as Y value which telling us what are xy-coordinates, and that is the key.
    I quadrant: +x,+y
    II quadrant: -x,+y
    III quadrant: -x,-y
    IV quadrant: +x,-y
    (look internet page with my link in post #26).

    Also look here: http://www.opticampus.com/files/intr...mic_optics.pdf page 116 and especialy page 117, on the top.
    Thank you for your vigilance in error checking, I mentioned previously the atan2 function and the constraints of the atan function in many programming languages. It didn't click until this post that I wasn't using it. I ran a truth table to show that each (x,y) scenario outputs a unique variable thus giving accurate results. The original formula is correct, but to translate it to a computer was where I kept failing. I learned a lot from this thread. Here is a picture of the truth table and the results.
    Attached Thumbnails Attached Thumbnails exampletest.png  
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  8. #33
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Yes your formula works. Nice way to avoid divide-by-zero error.
    Wow, now we have a plenty formulas for the same job! But, your last is the shorter. Thanks, I also learn a lot.
    Last edited by Wlada; 08-20-2015 at 06:24 PM.

  9. #34
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote Originally Posted by Wlada View Post
    Yes your formula works. Nice way to avoid divide-by-zero error.
    Wow, now we have a plenty formulas for the same job! But, your last is the shorter. Thanks, I also learn a lot.
    I have been trying a new challenge with these types of formulas, try to fit a calculator into a tweet. I have this one down to a little under two tweets.

    Code:
    javascript:m=Math,a=0,b=-10,c=88,e=0,f=-2,g=0;function r(x){return x*m.PI/180};h=a+b/2+e+f/2;i=b*m.cos(r(2*c))+f*m.cos(r(2*g));j=b*m.sin(r(2*c))+f*m.sin(r(2*g));k=m.sqrt(m.pow(i,2)+m.pow(j,2));l=h-k/2;m=(m.atan2(j,i)/2)*180/m.PI;m=(m<0)?m+180:m;alert("S:"+l+"C:"+k+"A:"+m);
    Last edited by MakeOptics; 08-20-2015 at 06:50 PM.
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  10. #35
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    try to fit a calculator into a tweet
    How? What language it is? I know something to do only in BASIC in OpenOffice.

  11. #36
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    javascript, it can be done in basic very simply as well. If you copy the code, then delete the location in your browser then paste it should put up a prompt of an example you gave earlier.
    http://www.opticians.cc

    Creator of the industries 1st HTML5 Browser based tracer software.
    Creator of the industries 1st Mac tracer software.
    Creator of the industries 1st Linux tracer software.

  12. #37
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    Yes, I know the commonly available formula's but there is a method to remove the if statements. I think I have found it, the original formula substituting ATAN(C045/C000) with ATAN2(C045,C000)
    The truth is that atan2 has inside this if statements, so it is easier for user to deal with this function (if we talking about atan2 function in spreadsheet).
    https://en.wikipedia.org/wiki/Atan2
    Last edited by Wlada; 08-21-2015 at 08:59 AM.

  13. #38
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    javascript, it can be done in basic very simply as well. If you copy the code, then delete the location in your browser then paste it should put up a prompt of an example you gave earlier.
    Ok, I think I figure. I will tell you what I done. I must refresh my memory about HTML, CSS...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. pure cylinder lens oblique axis with prescribed prism
    By gvolpe in forum Ophthalmic Optics
    Replies: 5
    Last Post: 02-22-2011, 01:21 AM
  2. Using optical cross to find power in oblique meridians
    By Java99 in forum General Optics and Eyecare Discussion Forum
    Replies: 39
    Last Post: 11-25-2010, 08:20 PM
  3. Cylinder in an Oblique meridian
    By musicvirtuoso in forum Ophthalmic Optics
    Replies: 1
    Last Post: 08-14-2010, 09:25 AM
  4. Oblique Cylinder Chart Question
    By Strab in forum Ophthalmic Optics
    Replies: 9
    Last Post: 05-06-2010, 08:38 AM
  5. oblique cross prism calculation
    By rob in uk in forum Ophthalmic Optics
    Replies: 6
    Last Post: 01-17-2009, 03:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •