Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paraxial matrix for arbitrary tilts #7

Open
MaximilianHoffmann opened this issue Jun 8, 2016 · 2 comments
Open

paraxial matrix for arbitrary tilts #7

MaximilianHoffmann opened this issue Jun 8, 2016 · 2 comments

Comments

@MaximilianHoffmann
Copy link

MaximilianHoffmann commented Jun 8, 2016

def paraxial_matrix(self, n0, l):
        # Reflection and Refraction of Gaussian Light Beams at
        # Tilted Ellipsoidal Surfaces
        # G. A. Massey and A. E. Siegman
        # Applied Optics IP, vol. 8, Issue 5, p.975
        #
        # [y', u'] = M * [y, u]
        n, md = super(Spheroid, self).paraxial_matrix(n0, l)
        c = self.curvature
        if self.aspherics is not None:
            c = c + 2*self.aspherics[0]
        theta = self.angles[0] if self.angles is not None else 0.
        costheta = np.cos(theta)
        m = np.eye(4)
        if self.material is not None:
            if self.material.mirror:
                m[2, 0] = 2*c*costheta
                m[3, 1] = 2*c/costheta
            else:
                mu = n/n0
                p = np.sqrt(mu**2 + costheta**2 - 1)
                m[1, 1] = p/(mu*costheta)
                m[2, 0] = n0*c*(costheta - p)
                m[3, 1] = mu*m[2, 0]/(costheta*p)
                m[3, 3] = 1/m[1, 1]
        m = np.dot(m, md)

        if self.angles is not None:
            # FIXME angles is incomplete:
            # rotate to meridional/sagittal then compute total incidence
            # angle, matrix, then rotate back
            phi = self.angles[2]
            cphi, sphi = np.cos(phi), np.sin(phi)
            r1 = np.array([[cphi, -sphi], [sphi, -cphi]])
            r = np.eye(4)
            r[:2, :2] = r[2:, 2:] = r1
            m = np.dot(r, np.dot(m, r.T))

Maybe you could give me hint. It is unclear to me why the angle[0] would be in anyway special. Why is angle[1] not taken into account, or is this indeed what is meant by the FIXME comment: that we rotate the system until only one angle is nonzero?
But: Why is theta in the above function equal angle[0] and not something like u[0] +angle[0]

Thx
Max

@jordens
Copy link
Member

jordens commented Jun 8, 2016

The treatment of arbitrarily tilted spheroids is incomplete (that's why there is the FIXME).

In a simple (planar) tilted system, angles[0] is the x-tilt ("in plane", a.k.a. theta) and the only rotation there is.
angles is an rxyz-style set of euler angles. In an element with only a an x and a z tilt, theta = angles[0] and phi = angles[2]. u is the angle of the ray and doesn't matter for the matrix.

For "general" tilts, it is more complicated and needs to be calculated as sketched out in the FIXME.

@jordens
Copy link
Member

jordens commented Jun 8, 2016

Also note that the phi code segment doesn't matter yet anyway since there are no cylindrical elements implemented.

@jordens jordens changed the title paraxial matrix for spheroids paraxial matrix for arbitrary tilts Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants