# Thread: calculation for compensat lens

1. ## calculation for compensat lens

i am looking for the full process of calculation (formulas) for compensation of prescription taking in consideration

1- vertex distance
2- pantoscopic tilt
3- wrap tilt -

for example

r- sph + 1.50 - 0.75 x 165 add - 2.00
L= sph + 1.00 - 1.00 x 90 add 2.00

distance reference - 15 fitted distance 12
pantoscopic tilt - 8
wrap 6

thanks
avi

2. ## Distilled down to provide simple calculations and still be understandable.

Our prescription is composed of the effective parameters:
$
Sph_{e} \\
Cyl_{e} \\
axis_{e}
$

Step 1 - compute the effective tilt angle of the lens

$

\phi = tan^{-1}(\frac{\sqrt[2]{sin^2(face) + tan^2(panto)}}{cos(face)})

$

Step 2 - Compute the effective change factors for the Sagittal, Tangential, and Torsional components. (we can save ourselves a bit of work by computing the Sagittal meridians change factor first and using it in our other components and the equations further simplify, I have also used the geometric mean for the torsional change factor instead of the arithmetic mean)

$

S_{c} = 1 + \frac{sin^2(\phi)}{2*n} \\
T_{c} = \frac{S_{c}}{cos^2(\phi)} \\
H_{c} = \frac{S_{c}}{cos(\phi)}

$

Step 3 - Rotate the local coordinate system of the Rx so that the sagittal and tangential meridians of our tilt and Rx align (conventional papers on the subject recommend that this rotation be compensated for the left eye by subtracting both the angles below from 90, however by substituting a negative faceform for the left eye instead of positive this accomplishes the same thing and is simpler to code and remember)

$

A = tan^{-1}(\frac{tan(panto)}{sin(face)}) \\
A" = tan^{-1}(\frac{sin(panto)}{tan(face)})

$

Step 4 - Rotate our prescription. (we are just rotating the original axis, the sph and cyl remain the same)

$

axis_{A} = axis_{e} - A

$

Result of Step 4 is the Prescription we will work on in the remaining steps, this prescription is a rotated coordinate system so that the effects of both the sagittal and tangential meridians align with how our lenses are tilted.

$

Sph_{e} \\
Cyl_{e} \\
axis_{A}

$

Step 5 - Convert from sphero-cylindrical to a power matrix

$

P_{e} = \begin{bmatrix}
P_{ex} & P_{et} \\
P_{et} & P_{ey} \\
\end{bmatrix} =
\begin{bmatrix}
Sph_{e} + Cyl_{e} * sin^2(axis_{A}) & -Cyl_{e} * cos(axis_{A}) * sin(axis_{A}) \\
-Cyl_{e} * cos(axis_{A}) * sin(axis_{A}) & Sph_{e} + Cyl_{e} * cos^2(axis_{A}) \\
\end{bmatrix}

$

Step 6 - now we compensate by our change factors

$

P_{c} = \begin{bmatrix}
P_{cx} & P_{ct} \\
P_{ct} & P_{cy} \\
\end{bmatrix} =
\begin{bmatrix}
\frac{P_{ex}}{T_{c}} & \frac{P_{et}}{H_{c}} \\
\frac{P_{et}}{H_{c}} & \frac{P_{ey}}{S_{c}} \\
\end{bmatrix}

$

Step 7 - Convert the compensated power matrix back into sphero-cylinder form

$

t = P_{cx} + P_{cy} \\
d = P_{cx}*P_{cy} - P_{ct}^2 \\
\\
Cyl" = \pm\sqrt[2]{(t^2 - 4d)} \\
Sph" = \frac{t - Cyl"}{2} \\
axis"_{A} = tan^{-1}(\frac{S - P_{cx}}{P_{ct}})

$

Step 8 - Don't forget we rotated the coordinate system to simplify the compensation, now we need to rotate it back

$

axis" = axis"_{A} + A"

$

So the answer and result is: Sph" Cyl" axis"

Not a simple or difficult equation to walk through or understand. Relatively easy to program. That's as simple as I can make the steps with a few shortcuts added in. There are two main research papers that deal with this topic one by Keating and another by Blendowski. The method provided above is a meld of the two with a shortcut of my own added in for good measure.

Another calculator is available at http://mccardle.me/brent/calculators/
The web version is optimized for mobile.

If you are looking for the calculations you will need to get the paper titled "Oblique Central Refraction in Spherocylindrical Corrections with Both Faceform and Pantoscopic Tilt" by Michael Keating

This paper uses Matrix algebra along with some other advanced calculations, but it is a great read if you are interested.

4. Originally Posted by lensgrinder

Another calculator is available at http://mccardle.me/brent/calculators/
The web version is optimized for mobile.

If you are looking for the calculations you will need to get the paper titled "Oblique Central Refraction in Spherocylindrical Corrections with Both Faceform and Pantoscopic Tilt" by Michael Keating

This paper uses Matrix algebra along with some other advanced calculations, but it is a great read if you are interested.
Years ago I derived a formul for tilt only considering the sph and cyl values it was until the papers mentioned in Brents post that I understood the torsional component and the rotation both before and afterwards. I do have an android version of the app available but to get it I would need to see an understanding of the formulas and paper before I sent it, I'm just picky like that. If you can give an example of the above equations worked out with a unique example (not from the texts) then I can send it to you to sideload.

5. Originally Posted by MakeOptics
I do have an android version of the app available but to get it I would need to see an understanding of the formulas and paper before I sent it, I'm just picky like that. If you can give an example of the above equations worked out with a unique example (not from the texts) then I can send it to you to sideload.
Thank you for the offer, but I use iOS so I would have no need for the app. I can assure you that I do have an understanding of the equations and the paper or I would not have been able to write the iOS app and the web app.

6. Originally Posted by lensgrinder
Thank you for the offer, but I use iOS so I would have no need for the app. I can assure you that I do have an understanding of the equations and the paper or I would not have been able to write the iOS app and the web app.
Brent,

Sorry I didn't mean to write it to you, but to the original poster who should really read the paper and understand it before using tools like your calculator. I know you teach optics and do a phenomenal job of it, I have the utmost respect for your knowledge and position. Again I greatly apologize for the way the message was received.

To the original poster if you have an android device here is a complementary app, I would still recommend reading and understanding the paper that Brent provided.

http://www.optiboard.com/forums/show...-(Android-App)

7. Originally Posted by lensgrinder
Thank you for the offer, but I use iOS so I would have no need for the app. I can assure you that I do have an understanding of the equations and the paper or I would not have been able to write the iOS app and the web app.
Rereading my post I see how I could have written it with more clarity, sometimes I end up taking too long to post and write in short sessions. Often needing to re-login, but then I forget that the first part of the post I intended to post that may have been written minutes or even hours before never was posted.

8. Thanks for the replay

2 more question

1. are we calculate the vertex distance before this calculation.
2. what will be the calculation for the add

thanks

Avi

9. Originally Posted by avi
Thanks for the replay

2 more question

1. are we calculate the vertex distance before this calculation.
2. what will be the calculation for the add

thanks

Avi
Yes, calc vertex first. The add needs a seperate compensation with a different panto tilt value taking into account the seg drop. A rule of thumb is 2 degrees per 1mm, however we could get a more accurate measure by calculating the eye's center of rotation. If we use the average human eye's diameter of 24mm, then the radius is 12mm.

$

sin(comppanto) = \frac{mfh}{vertex + 12mm}

$

The frame panto needs to be compensated a positive value would have this compensation subtracted from it to arrive an the effective panto tilt at the reading. Then the total reading power should be compensated based on this new effective panto measure. The compensated Rx arrived at for the reading should then have the distance compensated power subtracted from it to arrive at the additional power needed. The formulas for adding and subtracting powers is well documented in other threads including a more recent one, using astigmatic decomposition.

http://www.optiboard.com/forums/show...er-calculation

If using a traditional lens design then we need just the add power so a simple subtraction of the mean refractive error will suffice.

Additional parameters can be taken into account to provide more accuracy like the frame bevel tilt and decentration to arrive at the lens tilt which is a more accurate representation of the tilt then the frames tilt measures. Prism compensation is also necessary to offset the slight amount of prism produced by a skewed ray. Once again the paper that Brent recommended is a great place to start.

10. Originally Posted by MakeOptics
Brent,

Sorry I didn't mean to write it to you, but to the original poster who should really read the paper and understand it before using tools like your calculator. I know you teach optics and do a phenomenal job of it, I have the utmost respect for your knowledge and position. Again I greatly apologize for the way the message was received.

To the original poster if you have an android device here is a complementary app, I would still recommend reading and understanding the paper that Brent provided.

http://www.optiboard.com/forums/show...-(Android-App)
I did not think you meant anything. No worries!

Nice app!

11. thanks

12. Originally Posted by lensgrinder
I did not think you meant anything. No worries!

Nice app!
Thanks, your opinion means a lot to me. I don't want you to think I take your knowledge or posts for granted, I regularly read your posts when I see them because of the quality of content you provide. I also recommend your app to others I work with when I see they have an iPhone.

13. thanks
if i understand you corectly the new angel for the add will be the coopnsat angle or if will be the diviation betwwe then

for example mph 12
vertex fiting 12 and 12 mm eys that give 30 degree - this is the new angel i'm using for the add power compnsation?

can you give me also samples?

thanks

Avi

14. Originally Posted by avi
thanks
if i understand you corectly the new angel for the add will be the coopnsat angle or if will be the diviation betwwe then

for example mph 12
vertex fiting 12 and 12 mm eys that give 30 degree - this is the new angel i'm using for the add power compnsation?

can you give me also samples?

thanks

Avi
MFH = Minimum fitting height

in practice using the sin is going to be difficult since we would need to measure the vertex on gaze through the reading, and assuming the vertex remains the same through ocular rotation is a bad assumption. Often I substitute with the tan, discussions with the late Darryl Meister confirmed that sin would be more accurate if the vertex could be measured in gaze.

As an example if you were using a lens that fit at 18mm and the vertex for the patient is 12mm in the frame, then

tan(comppanto) = 18mm / (12mm + 12mm) = 18 / 24 = 0.75
comppanto = tan^-1(0.75) = 36.9 degrees

Assume that the panto is 15 degrees for the frame:

effective panto = 15 - 36.9 = -21.9 degrees

That would be the new panto to use in the above referenced formula, along with the total power at reading. Of course you could still incorporate prism thinning and bevel tilt to get at an even more accurate lens tilt, but this is only a third order relationship anyway so it's more accurate but still not accurate.

15. thank a lot

i asume that after calculate the add power we will get deffernt cyl and angel from the sph calculation

so we need to use Axis problem in oblique cross-cylinder calculation
or just using subtraction of the mean refractive error will suffice

thanks
Avi

16. Originally Posted by avi
thank a lot

i asume that after calculate the add power we will get deffernt cyl and angel from the sph calculation

so we need to use Axis problem in oblique cross-cylinder calculation
or just using subtraction of the mean refractive error will suffice

thanks
Avi
Depends if you are ordering a digital design they should be able to customize the Rx in both zones although I don't think anyone is currently doing that with outside calculations. For a traditional molded design the MRE will suffice since we don't have any other control over the outcome.

If you are interested in going even deeper down the rabit hole then you can calculate the thickness at 090 and 180, then use the bevel setting 40/60, front, back, basecurve, etc to calculate the thickness at both sides of the meridian and use those figures to calculate the tilt due to beveling and decentration. If you have a progressive lens design you would need to also consider prism thinning and the difference in thickness of the top portion of the lens compared to the bottom due to the change in power and then calc out the lens tilt. Aspherics can throw off the calcs but can be computed into the tilt as well to account for the change in curvature which will effect the lens tilt.

As an optician all of these additional layers of accuracy are all moot since the cost to have me factor everything in on each and every job would make the lens cost prohibitive to the patient, but as a programmer I only have to create the algorithm once, write out the pseudo code, then program the calculator and from that point forward I can calc any client with very little effort. The link to the calc provided her is a basic function consisting of the above formula with no additional lens tilt calced in.

To see the code here is a fiddle: http://jsfiddle.net/harrychiling/bsmhcege/

HTML Code:
//helper functions to simplify the code
function sq(x) {return Math.pow(x,2);}
function si(x) {return Math.sin(x);}
function asi(x) {return Math.asin(x);}
function co(x) {return Math.cos(x);}
function aco(x) {return Math.acos(x);}
function ta(x) {return Math.tan(x);}
function ata(x) {return Math.atan(x);}
function par(x) {return parseFloat(x);}
function sqr(x) {return Math.sqrt(x);}
function rnd(x,y) {return (Math.round(x*y)/y);}
function d2r(x) {return x*(Math.PI/180);}
function r2d(x) {return x*(180/Math.PI);}
function ata2(x) {return Math.atan2(x,1);}
var pi = Math.PI;
function nozero(x) {return (x===0)? 0.0001 : x;}

function comp(sph, cyl, axis, p, f, n, side) {
// variable declarations
sph = par(sph);
cyl = par(cyl);
axis = d2r(par(axis));
p = d2r(par(p));
f = d2r(par(f));
n = par(n);
side = (side==="L");

//effective tilt
var tilt = ata(sqr(sq(si(f))+sq(ta(p)))/nozero(co(f)));

//comp values
var sc = 1+(sq(si(tilt)))/(2*n);
var tc = sc/sq(co(tilt));
var hc = sc/co(tilt);

//coordinate rotation
var tanA = ta(p)/nozero(si(f));
var A = ata(tanA);
A = (side)? (pi/2)-A : A;
var tA = axis-A;

//effective power matrix
var Pxe = sph+cyl*sq(si(tA));
var Pye = sph+cyl*sq(co(tA));
var Pte = (-1)*cyl*si(tA)*co(tA);

//compensated power matrix rotated
var Px = (side)? Pxe/nozero(sc) : Pxe/nozero(tc);
var Py = (side)? Pye/nozero(tc) : Pye/nozero(sc);
var Pt = Pte/hc;

//trace and determinant
var trc = Px+Py;
var det = Px*Py-sq(Pt);

//rotated sphero-cylinder power
var c = (-1)*sqr(sq(trc)-4*det);
var s = (trc-c)/2;
var tA2 = ata((s-Px)/nozero(Pt));

var A2 = ata(si(p)/nozero(ta(f)));
A2 = (side)? (pi/2)-A2 : A2;

//rotate the coordinate system back
var ax = tA2 + A2;
ax = (ax<pi)? ax+pi : ax;
ax = (ax>pi)? ax-pi : ax;

//comp power
s = rnd(s,100);
c = rnd(c,100);
ax = (c===0)? pi : ax;
ax = rnd(r2d(ax),1);
ax = (ax===0)? 180 : ax;

//display
results = String(s) + "DS " + String(c) + "DC x " + String(ax);

return false;
}
You'll notice it is eerily similar to opticampus calculator but works faster, I even recreated a rounding error that occurs if you enter a decimal in opticampus and compute twice.

17. thanks

in the free form design they have one cyl rate -
is this a combination of sph calc and add calc
becouse once we calculate sph with pant and wrap we get result
and when we calculate the add power with the new compensate tilt we recieve differnt result - with new cyl and axis

what will be the true cyl and axis for this design

18. Dear

i'm a litel beet confuse

can you help and make for me the full calculation of this sample

r- sph + 1.50 - 0.75 x 165 add - 2.00
L= sph + 1.00 - 1.00 x 90 add 2.00

distance reference - 15 fitted distance 12
pantoscopic tilt - 8
wrap 6
asuming that mfh = 20

the have felling that the result i got was not corect

Avi

19. Dear Sir

i'm a litel beet confuse

can you help and make for me the full calculation of this sample

r- sph + 1.50 - 0.75 x 165 add - 2.00
L= sph + 1.00 - 1.00 x 90 add 2.00

distance reference - 15 fitted distance 12
pantoscopic tilt - 8
wrap 6
asuming that mfh = 20

the have felling that the result i got was not corect

Avi

20. hi somone can help to give me way of solution my samples above?

thanks

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

#### Posting Permissions

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