4. Positioning Functions

Introduction

Loading

4.1 Using Move

4.2 Using MoveLinear

4.3 Using MoveDirected

4.4 Using MoveReflected

Introduction to Chapter 4

To put an optical element at a location other than x = 0, y = 0, and z = 0, you will need to use one of LensLab's positioning directives. For many optical systems, the simple Move command is sufficient for component and ray placements. However, for three-dimensional placements of objects or for careful alignment of components and rays, you can use several Move related commands to facilitate object placement. We examine in this chapter the various built-in Move commands, including MoveLinear, MoveDirected, and MoveReflected. As we will see, some Move commands work best for lenses and transmissive components while other Move commands are best suited for mirrors and reflective components.

Loading LensLab

Make sure that the LensLab package is located either in the home directory, or on a directory path recognized by Mathematica for packages. The LensLab package is named LensLab.m and located in the LensLab directory, and the LensLab package is loaded with the following expression.

In[1]:=

Needs["LensLab`LensLab`"]

LensLab version 1.5 is now loaded.

This loading process should only take a few seconds. In addition to being loaded as a package, the LensLab.m file is formatted as a Mathematica notebook. The LensLab source code is made accessible so that you can develop new functions of your own by studying LensLab's built-in functions. This is particularly helpful when you wish to model new component ideas in LensLab. However, you should receive permission from Optica Software before distributing any user-created functions that are derived from the LensLab source code. The unauthorized distribution of LensLab-derived code may be a LensLab license agreement violation or a copyright infringement.

4.1 Using Move

The most important positioning directive in LensLab is the Move function. You can use Move to position both light sources and rays in space.  With this command, there is full control over both translations and rotations of the object in three-dimensional space. The basic definition for Move is shown below.

Move[objectset, {x, y}, rotationangle, options] is used to move the relative position and orientation of a set of components and rays within a horizontal plane.

Here, the rotationangle determines the angular orientation of the object set within the horizontal plane. You can use the TwistAngle -> angle option to specify a rotation angle around the axis of orientation. Next we will use Move together with DrawSystem to draw two lenses spaced apart from each other. Place the first one at x = 0, y = 0, with no rotation, and a second one at x = 100, y = 10, with a 45-degree rotation.

In[293]:=

DrawSystem[{
    PlanoConvexLens[100, 50, 10],
    Move[PlanoConvexLens[100, 50, 10], {100, 10}, 45]}, Axes -> True]

[Graphics:HTMLFiles/chapter4_2.gif]

Out[293]=

{{PlanoConvexLens, PlanoConvexLens}, -OpticsGraphics-}

There are many ways of assigning arguments to Move. Although only a single format has been shown previously for Move, there are actually a variety of input formats used with Move. These are shown below.

Move[objectset, {x, y}, rotationangle]
Move[
objectset, x, rotationangle]
Move[
objectset, x]
Move[
objectset, {x, y}]
Move[
objectset, {x, y, z}]
Move[
objectset, {x, y, z}, axisvector]
Move[
objectset, {x, y, z}, axisvector, twistangle]
Move[
objectset, {x, y, z}, rotationmatrix]

Common input formats for Move. Although not shown, these formats all accept options.

Of the present input formats, Move[objectset, {x, y, z}, axisvector, twistangle] is the basic command used for full three-dimensional object placements. With this command, there is full control over both translations and rotations of the object in three-dimensional space.

Move[objectset, {xpos, ypos, zpos}, tiltvector, twistangle, options]moves the relative position and orientation of a set of components and rays in three-dimensional space.

The tiltvector is a three-dimensional unit vector that points the direction of the axis of orientation. The twistangle specifies a rotation around the axis of orientation. Here we use Move.

In[2]:=

DrawSystem[{
    Move[PlanoConvexLens[100,{50,25},10],
        {0,0,0},{1,0,0},0],
    Move[PlanoConvexLens[100,{50,25},10],
        {50,50,50},{1,1,1},0],
    Move[PlanoConvexLens[100,{50,25},10],
        {50,0,0},{0,0,1},45]}];

[Graphics:HTMLFiles/chapter4_4.gif]

Go to list of topics

4.2 Using MoveLinear

MoveLinear is particularly useful for systems employing a series of optics along a rail. By specifying a starting point and ending point for the train, the position of the component can be given as a distance from the starting point.

MoveLinear[objectset, {xstart, ystart}, lineposition, {xend, yend}, options]moves the relative position and orientation of a set of components and rays along a line specified by a starting point and ending point within the horizontal plane.

MoveLinear[objectset, {xstart, ystart, zstart}, lineposition, {xend, yend, zend}, twistangle, options] moves the relative position and orientation of a set of components and rays along a line specified by a starting point and ending point in three-dimensional space.

Here we use MoveLinear.

In[3]:=

DrawSystem[{
    MoveLinear[ConeOfRays[10, NumerOfRays->6],{0,0},0,{200,125}],
    MoveLinear[ PlanoConvexLens[100,50,10],
        {0,0},100,{200,125}],
    MoveLinear[ PlanoConvexCylindricalLens[100,50,10],
        {0,0},150,{200,125},TwistAngle->90],
    MoveLinear[
        Move[ThinParabolicMirror[50,50,OffAxis->{25,0}],
        {0,-25,0}],{0,0},250,{200,125}],
    Boundary[{0,0,-100},{250,150,100}]},PlotType -> TopView];

[Graphics:HTMLFiles/chapter4_5.gif]

Here is the three-dimensional view.

In[4]:=

ShowSystem[%];

[Graphics:HTMLFiles/chapter4_6.gif]

Go to list of topics

4.3 Using MoveDirected

In cases involving lenses or other transmissive objects, very often the orientation of the object is dependent on a particular optical axis. MoveDirected uses a second point in space for defining the optical axis.

MoveDirected[objectset, {xpos, ypos}, {xpoint, ypoint}, options] moves the relative position and orientation of a set of components and rays within a horizontal plane whose axis of orientation is defined by a line intersecting the object's position and a second defined point in the plane.

MoveDirected[objectset, {xpos, ypos, zpos}, {xpoint, ypoint, zpoint}, twistangle, options] moves the relative position and orientation of a set of components and rays in three-dimensional space, whose axis of orientation is defined by a line intersecting objectset and a second defined point in space.

Here we use MoveDirected.

In[6]:=

DrawSystem[{
    MoveDirected[WedgeOfRays[10, NumerOfRays->6],{0,0},{100,85}, SideOfObject->After],
    MoveDirected[PlanoConvexLens[100,50,10],
        {100,85},{0,0},SideOfObject->Before],
    Boundary[{-100,-100,-100},{150,150,100}]},
    PlotType->TopView];

[Graphics:HTMLFiles/chapter4_7.gif]

Go to list of topics

4.4 Using MoveReflected

In cases involving involving mirrors or other reflective components, very often the orientation of the object is dependent on a reflected optical axis. MoveReflected determines the object orientation by using three points in space to define the reflected optical axis.

MoveReflected[objectset, {xbegin, ybegin}, {xpos, ypos}, {xend, yend}, options] moves the relative position and orientation of a set of components and rays within a horizontal plane whose axis of orientation is defined by a line intersecting the objectset and bisecting a starting point and ending point in the plane.

MoveReflected[objectset, {xbegin, ybegin, zbegin}, {xpos, ypos, zpos}, {xend, yend, zend}, twistangle, options] is used to move the relative position and orientation of a set of components and rays in three-dimensional space, whose axis of orientation is defined by a line intersecting the objectset position and bisecting a starting point and ending point in space.

Here is an example using MoveReflected. As shown below, often MoveDirected and MoveReflected are used as complementary operations on transmissive and reflective objects.

In[8]:=

DrawSystem[{
    MoveDirected[WedgeOfRays[10, NumerOfRays->6],{0,0},{100,85}, SideOfObject->After],
    MoveReflected[ThinMirror[50],{0,0},{100,85},{85,0}],
    MoveDirected[PlanoConvexLens[100,50,10],
        {85,0},{100,85},SideOfObject->Before],
    Boundary[{-100,-100,-100},{150,150,100}]},
    PlotType->TopView];

[Graphics:HTMLFiles/chapter4_8.gif]

We will now examine MoveReflected for three-dimensional placement of objects.

In[11]:=

DrawSystem[{
    MoveDirected[ConeOfRays[10, NumerOfRays->6],{0,0,0},{100,85,55},0, SideOfObject->After],
    MoveReflected[ThinMirror[50],{0,0,0},{100,85,55},{85,0,55},0],
    MoveDirected[PlanoConvexLens[100,50,10], {85,0,55},{100,85,55},0,SideOfObject->Before],
    Boundary[{-100,-100,-100},{150,150,100}]}];

[Graphics:HTMLFiles/chapter4_9.gif]

By using several views, we can better appreciate the three-dimensional nature of the resulting ray trace.

In[12]:=

ShowSystem[%,PlotType->TopView];

[Graphics:HTMLFiles/chapter4_10.gif]

In[13]:=

ShowSystem[%,PlotType->FrontView];

[Graphics:HTMLFiles/chapter4_11.gif]

As we have seen in this section, the placement of objects can be greatly facilitated using MoveDirected and MoveReflected. The MoveDirected function is more naturally used with transmissive objects while MoveReflected works best with reflective objects. Of course, all Move functions work equally well with rays or components and may be used to manipulate sets of rays and components simultaneously.

Go to list of topics

Copyright Statement

LensLab is a trademark of Optica Software.
Mathematica ® is a registered trademark of Wolfram Research, Inc. All other product names mentioned are trademarks of their producers. Mathematica is not associated with Mathematica Policy Research, Inc. or MathTech, Inc.
Copyright ©1995-2005 by Optica Software, Urbana, Illinois, Champaign, Illinois.

All rights reserved. No part of this document may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of the author, Optica Software.

Optica Software is the holder of the copyright to the LensLab package software and documentation ("Product") described in this document, including without limitation such aspects of the Product as its code, structure, sequence, organization, "look and feel", programming language and compilation of command names. Use of the Product, unless pursuant to the terms of a license granted by Optica Software. or as otherwise authorized by law, is an infringement of the copyright.

Optica Software makes no representations, express or implied, with respect to this Product, including without limitations, any implied warranties of merchantability or fitness for a particular purpose, all of which are expressly disclaimed. Users should be aware that included in the terms and conditions under which Optica Software is willing to license the Product is a provision that the author, Optica Software and distribution licensees, distributors and dealers shall in no event be liable for any indirect, incidental or consequential damages, and that liability for direct damages shall be limited to the amount of the purchase price paid for the Product.

In addition to the foregoing, users should recognize that all complex software systems and their documentation contain errors and omissions. Optica Software shall not be responsible under any circumstances for providing information on or corrections to errors and omissions discovered at any time in this document or the package software it describes, whether or not they are aware of the errors or omissions. Optica Software does not recommend the use of the software described in this document for applications in which errors or omissions could threaten life, injury or significant loss.

Go to list of topics


Created by Mathematica  (November 2, 2005)