Page 1 of 2 12 LastLast
Results 1 to 25 of 38

Thread: Axis problem in oblique cross-cylinder calculation

  1. #1
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32

    [SOLVED] Axis problem in oblique cross-cylinder calculation

    Hello, I tried to make some spreadsheet where I will solve oblique cross-cylinders. I am comparing results with Crossed Cylinders Calculation Form (http://www.opticampus.com/tools/cylinders.php) and only where I failed is in orientation of resulting axis. I really tried to fix this but I can not see the right rules for that, so please help me. Here is, in pdf file, way how I done calculation. In the same example calculator on Opticampus find axis on 74 degree ("-" cylinder form) and my result is 164 (90 degrees of diff.).
    Thanks in advance
    Attached Files Attached Files
    Last edited by Wlada; 08-26-2015 at 03:12 PM.

  2. #2
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    The ATAN function returns a value between -pi/2 to pi/2 or -90 to 90, tangent functions have a domain the cross cyl formula doubles the axis, so either check the axis while doubled to see if it falls within the domain and add 180 or divide the doubled angle and then check it, adding 90 if the axis is negative.

    PS - don't use the cross cyl formula you find in books, it is a convoluted version of a lens summation which is simpler to memorize and where the cross cyl formula was derived.

    MRE = Sph + Cyl/2
    C000 = C * cos(2*axis)
    C045 = C * sin(2*axis)

    You can add the two prescriptions Mean Refractive Errors and Cylinder powers at 000 and 045 together to come up with the total power, the advantage is that you can have a series of lenses and add them all together with this simple methods rather than performing the cross cyl method on two sets of lenses then using the result to add another lens when required.

    To covert back to prescription notation:

    Cyl = Sqrt(C000^2 + C045^2)
    Axis = tan-1(C045/C000)/2
    Sph = MRE - Cyl/2

    Excel provided below with logic and radians to degree and back.
    Attached Files Attached Files
    Last edited by MakeOptics; 08-16-2015 at 08:17 PM. Reason: removed excel corrected error, see attachment below
    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. #3
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Thanks for yours reply and spreadsheet. I tested yours formulas, and for now there is a problem for axis when both cylinder are positive and when both axes are between 0-90 degree. For example:
    L1: 0,00=+10,00 ax 0 and
    L2: 0,00=+2,00 ax15
    gives
    +11,89=-11,77 ax2
    but it should be ax92.
    Last edited by Wlada; 08-01-2015 at 04:44 PM.

  4. #4
    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
    Thanks for yours reply and spreadsheet. I tested yours formulas, and for now there is a problem for axis when both cylinder are positive and when both axes are between 0-90 degree. For example:
    L1: 0,00=+10,00 ax 0 and
    L2: 0,00=+2,00 ax15
    gives
    +11,89=-11,77 ax2
    but it should be ax92.
    I probably ignored my own advice, I'll take a peak tonight. Thanks.
    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. #5
    Master OptiBoarder lensgrinder's Avatar
    Join Date
    Jul 2005
    Location
    Raleigh, NC
    Occupation
    Lens Manufacturer
    Posts
    506
    Opticampus transposes to minus cylinder form before the calculations are performed.
    Your pdf is correct for both minus and plus cylinder form your result is 74 because you performed the calculations in plus cylinder.

    Your exapmle Rx

    0.00 +10.00 X 165
    0.00 -0.50 X 5

    Transpose to minus cylinder

    +10.00 -10.00 X 75
    0.00 -0.50 X 5

    This will not change your result of -20.96 except that you will add this to 5 instead of 95

    New axis is 5 + (-20.96) = -15.96

    360 + (-15.96) = 344.04 - 180 = 164.04

    This is your axis in minus cylinder form.

  6. #6
    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
    Thanks for yours reply and spreadsheet. I tested yours formulas, and for now there is a problem for axis when both cylinder are positive and when both axes are between 0-90 degree. For example:
    L1: 0,00=+10,00 ax 0 and
    L2: 0,00=+2,00 ax15
    gives
    +11,89=-11,77 ax2
    but it should be ax92.
    Good catch, in a rush to throw an example up I skipped a step in the sheet. The resultant cylinder is always in plus form so the axis was for the plus cyl in my calc, I didn't add 90 to it. I updated it so you have a working example to see.
    Last edited by MakeOptics; 08-16-2015 at 02:40 PM. Reason: removed excel sheet for error
    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. #7
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    Good catch, in a rush to throw an example up I skipped a step in the sheet. The resultant cylinder is always in plus form so the axis was for the plus cyl in my calc, I didn't add 90 to it. I updated it so you have a working example to see.
    Between two vectors must be resultant vector. But if I put
    L1: 0.00=+10.00 ax170 and
    L2: 0.00=+1.00 ax 55
    with yours spreadsheet result is
    +0.81= +9.39 ax172
    Angle 172 is not between 55-170.
    This is occurs when diff. between ax L1 and ax L2 is >90.

  8. #8
    Master OptiBoarder lensgrinder's Avatar
    Join Date
    Jul 2005
    Location
    Raleigh, NC
    Occupation
    Lens Manufacturer
    Posts
    506
    Quote Originally Posted by Wlada View Post
    Between two vectors must be resultant vector. But if I put
    L1: 0.00=+10.00 ax170 and
    L2: 0.00=+1.00 ax 55
    with yours spreadsheet result is
    +0.81= +9.39 ax172
    Angle 172 is not between 55-170.
    This is occurs when diff. between ax L1 and ax L2 is >90.
    You should not get 172. You are adding to axis 55, if you are keeping it in plus cylinder form.



    2 X 115 = 230



    Now add 23.64 to your lower axis value(55).
    55+23.64 = 78.64

    78.64 is your axis in plus cylinder form.

  9. #9
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by lensgrinder View Post
    You should not get 172. You are adding to axis 55, if you are keeping it in plus cylinder form.



    2 X 115 = 230




    Now add 23.64 to your lower axis value(55).
    55+23.64 = 78.64

    78.64 is your axis in plus cylinder form.
    Lensgrinder, you using tanΘ=10*sin(230)/11*cos(230)
    About lower part 11*cos(230): are you first sum C1 and C2? Becuse that is different case and result. I found formula in text book as C1+C2*cos2[alpha], not (C1+C2)*cos2[alpha].

  10. #10
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    Good catch, in a rush to throw an example up I skipped a step in the sheet. The resultant cylinder is always in plus form so the axis was for the plus cyl in my calc, I didn't add 90 to it. I updated it so you have a working example to see.
    MakeOptics, if I have
    L1: 0,00=-10,00 ax 170 and
    L2: 0,00=-1,00 ax55
    your new spreadsheet gives
    -0.81=-9.39 ax82
    but Crossed Cylinders Calculation on OptiCampus gives ax172.

  11. #11
    Master OptiBoarder lensgrinder's Avatar
    Join Date
    Jul 2005
    Location
    Raleigh, NC
    Occupation
    Lens Manufacturer
    Posts
    506
    Quote Originally Posted by Wlada View Post
    Lensgrinder, you using tanΘ=10*sin(230)/11*cos(230)
    About lower part 11*cos(230): are you first sum C1 and C2? Becuse that is different case and result. I found formula in text book as C1+C2*cos2[alpha], not (C1+C2)*cos2[alpha].
    Thanks!
    Sorry I was in a hurry, but this did get me to looking at MakeOptics spreadsheet.



    Quote Originally Posted by Wlada View Post
    MakeOptics, if I have
    L1: 0,00=-10,00 ax 170 and
    L2: 0,00=-1,00 ax55
    your new spreadsheet gives
    -0.81=-9.39 ax82
    but Crossed Cylinders Calculation on OptiCampus gives ax172.
    According to "Ophthalmic Mechanics and Dispensing", Epting and Morgret



    First - divide by 2 and add to smaller axis
    Second - subtract from 180, divide by 2, and add to smaller axis
    Third - add to 180, divide by 2, and add to smaller axis
    Fourth - subtract from 360, divide by 2, and add to the smaller axis



    Using the above logic since it is it is in the first quadrant, you will divide 54.67 by 2 and add to 55.



    Use +10.00 X 170 and +1.00 X 55


    Since it is it is in the third quadrant, you will add 54.67 to 180, divide by 2, and add to 55.

    Last edited by lensgrinder; 08-04-2015 at 04:03 PM. Reason: Checking Facts

  12. #12
    Master OptiBoarder lensgrinder's Avatar
    Join Date
    Jul 2005
    Location
    Raleigh, NC
    Occupation
    Lens Manufacturer
    Posts
    506
    When you perform all of Thompson's formulae, it makes more sense. I was concentrating on the axis and could not understand why it gave an axis of 82 for the minus cylinder and 172 for the plus cylinder. I performed a Stokes Construction(attached) which shows the minus cylinder transposed to plus and where the angle bisector to C and F1 ends up in quadrant 1.

    Click image for larger version. 

Name:	stokes.jpg 
Views:	71 
Size:	50.3 KB 
ID:	12158

    So then I performed all the calculations:

    Pl -10.00 X 170
    Pl -1.00 X 55





    The axis from the above post is 82, so you have -10.20 + 9.39 X 82
    Transposed to minus cylinder, like Opticampus, -0.81 - 9.39 X 172

    Pl +10.00 X 170
    Pl +1.00 X 55





    The axis from the above post is 172, so you have 0.81 + 9.39 X 172
    Transposed to minus cylinder, like Opticampus, 10.20 - 9.39 X 82

  13. #13
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    I literally just whipped that sheet together and didnt intend for it to be a complete production calculator just an example to show how it could be coded and the algorithm simplified.
    Last edited by MakeOptics; 08-16-2015 at 02:41 PM. Reason: removed error
    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.

  14. #14
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    --
    Last edited by Wlada; 03-06-2016 at 05:22 PM.

  15. #15
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by lensgrinder View Post
    When you perform all of Thompson's formulae, it makes more sense. I was concentrating on the axis and could not understand why it gave an axis of 82 for the minus cylinder and 172 for the plus cylinder. I performed a Stokes Construction(attached) which shows the minus cylinder transposed to plus and where the angle bisector to C and F1 ends up in quadrant 1.
    Thanks for clarification. One question. How do you perform claculation when tang2{theta}= {some number}/{0}?
    Last edited by Wlada; 08-09-2015 at 10:57 AM.

  16. #16
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    Swap out the atan2 function that shoulg work 360 around. I literally just whipped that sheet together and didnt intend for it to be a complete production calculator just an example to show how it could be coded and the algorithm simplified.
    The same question: what if C0 is 0?
    There is some trick like if cell for C0 is 0 than put value 0.00000000000000000000000001, but this is not perfect solution...
    Last edited by Wlada; 08-09-2015 at 10:58 AM.

  17. #17
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    For any individual prescription that will never be the case since the angle is being doubled and then cosine of the doubled angle, their exists no cases where the result would be 0 for C000, however if the cyl is 0 then the product will be 0 in which case you have a sphere and the this could be checked for as a condition before the calculations begin. Their may be a rare case where the results of two scripts could cause their C000 components to cancel causing a 0 result for C000, the most obvious would be oblique cyls, however adding a small value like you proposed in your post will overcome this problem and provide negligible inaccuracy to the result. If that answer is not satisfactory, then you need to consider that floating point numbers on computers have always been inaccurate.
    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.

  18. #18
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Thanks for effort and clarifications. I think that I finished my work. MakeOptics, your way is much better for spreadsheet way of thinking, and yes, in yours way it can calculate more lenses then two. I introduced some changes, and I think that it works nice. I am in phase where compare this two ways of calculations with cross cyl calculator on OptiCampus, but, for now, I can not find differences. But, can you now some specific combination of lenses and axis where I can tested robustness of my spreadsheet functions?

  19. #19
    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
    Thanks for effort and clarifications. I think that I finished my work. MakeOptics, your way is much better for spreadsheet way of thinking, and yes, in yours way it can calculate more lenses then two. I introduced some changes, and I think that it works nice. I am in phase where compare this two ways of calculations with cross cyl calculator on OptiCampus, but, for now, I can not find differences. But, can you now some specific combination of lenses and axis where I can tested robustness of my spreadsheet functions?
    Decomposition:
    MRE = Sph + Cyl/2
    C000 = C * cos(2*axis)
    C045 = C * sin(2*axis)

    Conversion:
    Cyl = ±Sqrt(C000^2 + C045^2)
    Axis = tan-1(C045/C000)/2
    Sph = MRE - Cyl/2

    The two above macro steps are the main components of the calculations, so I would look at domain and range on each component. The only problems I see are:

    1. Sum of C000 = Cannot be equal to zero or a division by zero error.
    2. C000 of Rx1 and C000 of Rx2 = Cannot cancel out to zero or a division by zero error.


    For case 1, the cosine of any angle cannot be equal to "0", even the case of 090 in excel computes to 0.00000000000000006 because of the floating point error in computers this floating point error works in our favor since we don't need a separate case for this scenario and the inaccuracy is minuscule.

    For case 2, case 2 exists because cos and sin are essentially the same function out of phase, we need to make sure that the scenario cos(x-90) doesn't exist or the possibility of the two C000 components cancelling each other out are a real possibility. That means making sure that the two prescriptions cannot be simply added together first by transposition of one Rx or the other.
    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.

  20. #20
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Lensgrinder explained how to get good results in classic way, using formulas from textbooks. MakeOptics, approach what you described (C000 and C045) also get the same results, but not for axis. I was tested and here is results, or method how to get good axis for resultant cilinder:

    2Θ = tan-1(C045/C000)

    If C000>0 and C045>0 then ABS(2Θ)/2
    If C000<0 and C045>=0 then (360-ABS(2Θ))/2-90
    If C000<0 and C045<0 then ABS(2Θ)/2+90
    If C000>0 and C045<=0 then (360-ABS(2Θ))/2

    Last edited by Wlada; 08-16-2015 at 01:15 PM.

  21. #21
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    They are essentially the same formula presented in different ways. Still good to learn it multiple ways so you can spot them when you see them and understand what is happening. I had another typo in the sheets from above, fixed.
    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.

  22. #22
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Quote Originally Posted by MakeOptics View Post
    I had another typo in the sheets from above, fixed.
    Can you clarify?

  23. #23
    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
    Can you clarify?
    Since the cos function in excel has a range of -pi/2 to pi/2, which is -90 to 90 and the angle was doubled I was adding 180 to the result which I thought was a way to avoid an error in reality it was adding an error. I was overthinking the solution, instead of going with my gut. I looked into the cos function as well and ran every integer of a real angle through excel and cos never returns a 0 so division by 0 errors won't happen in the function.

    When I was in school I was deducted points on an exam for using astigmatic decomposition over Thompson's, my response was use Thompson's to subtract two obliquely crossed cylinders. The result was I was given my points back, after a good friend in NC confirmed my answers.
    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.

  24. #24
    OptiBoard Apprentice
    Join Date
    Jun 2015
    Location
    Serbia
    Occupation
    Optometrist
    Posts
    32
    Just to summarise, and everything to be in one place:
    Rules how to solve oblique crossed cylinders:
    1. Do transpositions that all cylinders be in "+" form.
    For any lens do next calculation:
    2. SE (spherical equivalent) = sph + cyl/2
    3. C000 = C*cos(2*axis)
    4. C045 = C*sin(2*axis)
    5. Sum all spherical equivalent of all lenses (SumSE)
    5. Sum all C000 (SumC000)
    6. Sum all C045 (SumC045)
    Resultant (r) lens:
    7. CYL(r) = sqrt(C000^2 + C045^) - cylinder is always „+“
    8. SPH(r) = SumSE – CYL(r)
    9. AX(r) =
    2Θ = Arctang(SumC045/SumC000)
    If SumC000>0 and SumC045>0 then ABS(2Θ)/2
    If SumC000<0 and Sum C045>=0 then (360-ABS(2Θ))/2-90
    If SumC000<0 and SumC045<0 then ABS(2Θ)/2+90
    If SumC000>0 and SumC045<=0 then (360-ABS(2Θ))/2
    10. If you need, do the transposition to get resultant lens with cylinders in „-“ form.

    If someone want calculation in way what is described by LensGrinder, look his posts above.

    Once again, Lensgrinder, MakeOptis, thanks for your time and effort.
    Last edited by Wlada; 08-17-2015 at 08:23 AM.

  25. #25
    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
    Just to summarise, and everything to be in one place:
    Rules how to solve oblique crossed cylinders:
    1. Do transpositions that all cylinders be in "+" form.
    For any lens do next calculation:
    2. SE (spherical equivalent) = sph + cyl/2
    3. C000 = C*cos(2*axis)
    4. C045 = C*sin(2*axis)
    5. Sum all spherical equivalent of all lenses (SumSE)
    5. Sum all C000 (SumC000)
    6. Sum all C045 (SumC045)
    Resultant (r) lens:
    7. CYL(r) = sqrt(C000^2 + C045^) - cylinder is always „+“
    8. SPH(r) = SumSE – CYL(r)
    9. AX(r) =
    2Θ = Arctang(SumC045/SumC000)
    If SumC000>0 and SumC045>0 then ABS(2Θ)/2
    If SumC000<0 and Sum C045>=0 then (360-ABS(2Θ))/2-90
    If SumC000<0 and SumC045<0 then ABS(2Θ)/2+90
    If SumC000>0 and SumC045<=0 then (360-ABS(2Θ))/2
    10. If you need, do the transposition to get resultant lens with cylinders in „-“ form.

    If someone want calculation in way what is described by LensGrinder, look his posts above.

    Once again, Lensgrinder, MakeOptis, thanks for your time and effort.

    1. SE (spherical equivalent) = sph + cyl/2
    2. C000 = C*cos(2*axis)
    3. C045 = C*sin(2*axis)
    4. Sum all spherical equivalent of all lenses (SumSE)
    5. Sum all C000 (SumC000)
    6. Sum all C045 (SumC045)
    Resultant (rx) lens:
    7. CYL(rx) = sqrt(C000^2 + C045^2) [cylinder is always "+"]
    8. SPH(rx) = SumSE – CYL(rx)/2 (subtracting the cylinder/2 out of the spherical equivalent gives the the sphere)
    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)
    10. If you need, do the transposition to get resultant lens with cylinders in "-" form.
    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.

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
  •