主要内容

fieldPoint

Create field point representation of light source

Since R2026a

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

Light Source at Infinity

fa = fieldPoint creates a field point representation of a light source that consists of an on-axis object located at an infinite distance in front of the first surface of the optical system.

fa = fieldPoint(Angles=angles) creates light sources located an infinite distance from the first component in the optical system, at the specified angles from the optical axis.

example

Light Source at Finite Position

fp = fieldPoint(Name=Value) specifies options for creating light source representations at a finite distance from the first component in the optical system using one or more name-value arguments. For example, Position=[1 0 1] specifies the position of the light source as [1 0 1] in the global coordinate system.

example

Examples

collapse all

Create field points representing a light source in the yz-plane at 15 degrees below the optical axis, located at an infinite distance away from the first component in the optical system.

fa = fieldPoint(Angles=[15 0]);

Load an optical system containing a wide angle lens using the createWideAngle helper function attached to this example as a supporting file.

opsys = createWideAngle;

Trace rays through the optical system using the traceRays object function. Add the field point representing your light source to the optical system by specifying the FieldPoint name-value argument.

rays = traceRays(opsys,Wavelengths=optics.constant.Fraunhofer.d,FieldPoints=fa);

Display a 2-D visualization of the optical system using the view2d object function. Visualize the traced rays on the displayed optical system using the addRays object function.

hv = view2d(opsys);
hv.Title = "Wide Angle Lens System";
addRays(hv,rays)

Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title Wide Angle Lens System.

Create an optical system containing a wide angle lens by using the createWideAngle helper function, attached to this example as a supporting file.

opsys = createWideAngle;

Specify the position of the first light source located at an infinite distance in the *yz-*plane at 20 degrees above the optical axis using the fieldPoint function.

fp1 = fieldPoint(Angles=[-20 0]);

Specify the position of the second light source in the global coordinate system, located at a finite distance from the first surface, using the Position name-value argument.

fp2 = fieldPoint(Position=[0 50 0],ReferenceFrame="Global");

Combine the two light source representations into an array of field points.

fp = [fp1; fp2];

Trace rays through the optical system using the traceRays object function. Specify the FieldPoint name-value argument as the field point array.

rays = traceRays(opsys,Wavelengths=optics.constant.Fraunhofer.d,FieldPoints=fp);

Display a 2-D visualization of the optical system using the view2d object function. Visualize the traced rays on the displayed optical system using the addRays object function.

hv = view2d(opsys);
hv.Title = "Wide Angle Lens System";
addRays(hv,rays)

Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title Wide Angle Lens System.

Input Arguments

collapse all

Angles of the light source rays relative to the optical axis, specified as an N-by-2 numeric matrix. N is the number of light sources. Each row of the matrix is of the form [VerticalAngle HorizontalAngle], where the values VerticalAngle and HorizontalAngle must be in the range [–180, 180]. VerticalAngle and HorizontalAngle are the angles between the light rays and the optical z-axis in the yz-plane and in the xz-plane, respectively. Units are in degrees.

Specify this input argument to create a field point that represents a light source located very far away from the optical system, also known as an object at infinity.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: fieldPoint(Position=[1 0 1]) specifies the position of the light source as [1 0 1] in the global coordinate system.

Positions of light sources, specified as an N-by-2 or N-by-3 numeric matrix. N is the number of light sources. The format of this argument depends on the value of the ReferenceFrame argument:

  • "Global"N-by-3 numeric matrix, where each row is of the form the form [x y z]. Specifies the x-, y-, and z-coordinates of the light source in the global reference frame, in millimeters.

  • "Object"N-by-3 numeric matrix or N-by-2 numeric matrix, where each row is of the form [x y 0] or [x y], respectively. Specifies the x and y dimensions of the object, in millimeters, in the local coordinate system of the object plane.

  • "Image"N-by-3 numeric matrix or N-by-2 numeric matrix, where each row is of the form [x y 0] or [x y], respectively. Specifies x and y dimensions of the planar image, in millimeters, in the local coordinate system of the image plane of the optical system.

    Tip

    To specify a light source that spans the maximum field angle of the system, specify x and y as the top edges of the image plane. To compute the maximum half field of view of the optical system, use the halfFieldOfView function.

Reference frame, specified as "Global", "Object", or "Image". The value of this argument specifies the reference frame relative to which you specify the Position argument.

  • "Global" — Position represents the position of the light source relative to the global reference frame.

  • "Object" — Position represents the dimensions of a planar object imaged at a finite location, such as a projector optical system.

  • "Image" — Position represents the dimensions of the planar image formed at the image plane.

To learn more about working with optical coordinate systems, see Coordinate Systems in Optical Design.

Output Arguments

collapse all

Field angles representing light sources at infinity, returned as an N-by-1 vector of FieldAngle objects. N is the number of light sources.

Field positions representing light sources at finite distances away from the first surface of the optical system, returned as an N-by-1 vector of FieldPosition objects. N is the number of light sources.

Version History

Introduced in R2026a