4. Positioning Functions

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.

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:=

Needs["LensLab`LensLab`"] 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:=

DrawSystem[{
PlanoConvexLens[100, 50, 10],
Move[PlanoConvexLens[100, 50, 10], {100, 10}, 45]}, Axes -> True] Out= 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:=

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]}]; 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:=

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]; Here is the three-dimensional view.

In:=

ShowSystem[%]; 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:=

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]; 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:=

DrawSystem[{
MoveDirected[WedgeOfRays[10, NumerOfRays->6],{0,0},{100,85}, SideOfObject->After],
MoveReflected[ThinMirror,{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]; We will now examine MoveReflected for three-dimensional placement of objects.

In:=

DrawSystem[{
MoveDirected[ConeOfRays[10, NumerOfRays->6],{0,0,0},{100,85,55},0, SideOfObject->After],
MoveReflected[ThinMirror,{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}]}]; By using several views, we can better appreciate the three-dimensional nature of the resulting ray trace.

In:=

ShowSystem[%,PlotType->TopView]; In:=

ShowSystem[%,PlotType->FrontView]; 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.

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.