Lucan-1.1.0
Safe HaskellNone
LanguageHaskell2010

Lucan

Synopsis

Types

Math.Types

data Shape #

Sum type of all geometric surface shapes.

Instances

Instances details
Eq Shape # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Shape -> Shape -> Bool #

(/=) :: Shape -> Shape -> Bool #

Show Shape # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

data Sphere #

Arbitrary sphere \[ F(x,y,z) = (x-P_x)^2 + (y-P_y)^2 + (z-P_z)^2 - R^2 = 0 \]

Constructors

Sphere 

Fields

Instances

Instances details
Eq Sphere # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Sphere -> Sphere -> Bool #

(/=) :: Sphere -> Sphere -> Bool #

Show Sphere # 
Instance details

Defined in Lucan.Math.Types

data SpherePx #

Sphere with center on x-axis \[ F(x,y,z) = (x-P_x)^2 + y^2 + z^2 - R^2 = 0\]

Constructors

SpherePx 

Fields

Instances

Instances details
Eq SpherePx # 
Instance details

Defined in Lucan.Math.Types

Show SpherePx # 
Instance details

Defined in Lucan.Math.Types

data SpherePy #

Sphere with center on y-axis \[ F(x,y,z) = x^2 + (y-P_y)^2 + z^2 - R^2 = 0\]

Constructors

SpherePy 

Fields

Instances

Instances details
Eq SpherePy # 
Instance details

Defined in Lucan.Math.Types

Show SpherePy # 
Instance details

Defined in Lucan.Math.Types

data SpherePz #

Sphere with center on z-axis \[ F(x,y,z) = x^2 + y^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

SpherePz 

Fields

Instances

Instances details
Eq SpherePz # 
Instance details

Defined in Lucan.Math.Types

Show SpherePz # 
Instance details

Defined in Lucan.Math.Types

data Plane #

Arbitrary plane \[ F(x,y,z) = A x + B y + C z - D = 0 \]

Constructors

Plane 

Fields

Instances

Instances details
Eq Plane # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Plane -> Plane -> Bool #

(/=) :: Plane -> Plane -> Bool #

Show Plane # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Plane -> ShowS #

show :: Plane -> String #

showList :: [Plane] -> ShowS #

data PlaneDx #

Plane with normal vector in direction of x-axis. \[ F(x,y,z) = x - D = 0 \]

Constructors

PlaneDx 

Fields

Instances

Instances details
Eq PlaneDx # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDx -> PlaneDx -> Bool #

(/=) :: PlaneDx -> PlaneDx -> Bool #

Show PlaneDx # 
Instance details

Defined in Lucan.Math.Types

data PlaneDy #

Plane with normal vector in direction of y-axis. \[ F(x,y,z) = y - D = 0\]

Constructors

PlaneDy 

Fields

Instances

Instances details
Eq PlaneDy # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDy -> PlaneDy -> Bool #

(/=) :: PlaneDy -> PlaneDy -> Bool #

Show PlaneDy # 
Instance details

Defined in Lucan.Math.Types

data PlaneDz #

Plane with normal vector in direction of z-axis. \[ F(x,y,z) = z - D = 0 \]

Constructors

PlaneDz 

Fields

Instances

Instances details
Eq PlaneDz # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDz -> PlaneDz -> Bool #

(/=) :: PlaneDz -> PlaneDz -> Bool #

Show PlaneDz # 
Instance details

Defined in Lucan.Math.Types

data Cylinder #

Arbitrary cylinder with radius \( R \) and central line defined by a position vector \( P = (P_x,P_y,P_z)^T \) and a direction vector \( D = (D_x,D_y,D_z)^T \). \[ F(x,y,z) = ||X-P||_2^2 - \langle X-P,D_n\rangle^2 - R^2 = 0 \] where: \[X = \begin{pmatrix}x\\y\\z\end{pmatrix}\] \[ D_n = \frac{D}{||D||_2} \]

Constructors

Cylinder 

Fields

Instances

Instances details
Eq Cylinder # 
Instance details

Defined in Lucan.Math.Types

Show Cylinder # 
Instance details

Defined in Lucan.Math.Types

data CylinderDx #

Cylinder with radius \( R \) and x-axis as central line. \[ F(x,y,z) = y^2 + z^2 - R^2 = 0\]

Constructors

CylinderDx 

Fields

Instances

Instances details
Eq CylinderDx # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDx # 
Instance details

Defined in Lucan.Math.Types

data CylinderDy #

Cylinder with radius \( R \) and y-axis as central line. \[ F(x,y,z) = x^2 + z^2 - R^2 = 0\]

Constructors

CylinderDy 

Fields

Instances

Instances details
Eq CylinderDy # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDy # 
Instance details

Defined in Lucan.Math.Types

data CylinderDz #

Cylinder with radius \( R \) and z-axis as central line. \[ F(x,y,z) = x^2 + y^2 - R^2 = 0\]

Constructors

CylinderDz 

Fields

Instances

Instances details
Eq CylinderDz # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDz # 
Instance details

Defined in Lucan.Math.Types

data CylinderPyzDx #

Cylinder with radius \( R \) parallel to x-axis and central going through \( (0,P_y,P_z)^T \) \[ F(x,y,z) = (y-P_y)^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

CylinderPyzDx 

Instances

Instances details
Eq CylinderPyzDx # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPyzDx # 
Instance details

Defined in Lucan.Math.Types

data CylinderPzxDy #

Cylinder with radius \( R \) parallel to y-axis and central going through \( (P_x,0,P_z)^T \) \[ F(x,y,z) = (x-P_x)^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

CylinderPzxDy 

Instances

Instances details
Eq CylinderPzxDy # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPzxDy # 
Instance details

Defined in Lucan.Math.Types

data CylinderPxyDz #

Cylinder with radius \( R \) parallel to z-axis and central going through \( (P_x,P_y,0)^T \) \[ F(x,y,z) = (x-P_x)^2 + (y-P_y)^2 - R^2 = 0\]

Constructors

CylinderPxyDz 

Instances

Instances details
Eq CylinderPxyDz # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPxyDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxDx #

Paraboloid of revolution with x-axis as central line opened in positive direction and its vertex at \( (P_x,0,0)^T \). \[ F(x,y,z) = -(x-P_x) + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ParabolPosPxDx 

Fields

Instances

Instances details
Eq ParabolPosPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPyDy #

Paraboloid of revolution with y-axis as central line opened in positive direction and its vertex at \( (0,P_y,0)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} - (y-P_y) + \frac{z^2}{A^2} = 0\]

Constructors

ParabolPosPyDy 

Fields

Instances

Instances details
Eq ParabolPosPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPyDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPzDz #

Paraboloid of revolution with z-axis as central line opened in positive direction and its vertex at \( (0,0,P_z)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} - (z-P_z) = 0\]

Constructors

ParabolPosPzDz 

Fields

Instances

Instances details
Eq ParabolPosPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDx #

Paraboloid of revolution opened in positive x-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = -(x-P_x) + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolPosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDy #

Paraboloid of revolution opened in positive y-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} -(y-P_y) + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolPosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDz #

Paraboloid of revolution opened in positive z-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} - (z-P_z) = 0\]

Instances

Instances details
Eq ParabolPosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxDx #

Paraboloid of revolution with x-axis as central line opened in negative direction and its vertex at \( (P_x,0,0)^T \). \[ F(x,y,z) = (x-P_x) + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ParabolNegPxDx 

Fields

Instances

Instances details
Eq ParabolNegPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPyDy #

Paraboloid of revolution with y-axis as central line opened in negative direction and its vertex at \( (0,P_y,0)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + (y-P_y) + \frac{z^2}{A^2} = 0\]

Constructors

ParabolNegPyDy 

Fields

Instances

Instances details
Eq ParabolNegPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPyDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPzDz #

Paraboloid of revolution with z-axis as central line opened in negative direction and its vertex at \( (0,0,P_z)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} + (z-P_z) = 0\]

Constructors

ParabolNegPzDz 

Fields

Instances

Instances details
Eq ParabolNegPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDx #

Paraboloid of revolution opened in negative x-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = (x-P_x) + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDy #

Paraboloid of revolution opened in negative y-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + (y-P_y) + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDz #

Paraboloid of revolution opened in negative z-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} + (z-P_z) = 0\]

Instances

Instances details
Eq ParabolNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxDx #

Cone of revolution with x-axis as central line opened in positive direction and its vertex at \( (P_x,0,0)^T \). \[ F(x,y,z) = - sign(x-P_x)\cdot(x-P_x)^2 + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ConePosPxDx 

Fields

Instances

Instances details
Eq ConePosPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxDx # 
Instance details

Defined in Lucan.Math.Types

data ConePosPyDy #

Cone of revolution with y-axis as central line opened in positive direction and its vertex at \( (0,P_y,0)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} - sign(y-P_y)\cdot(y-P_y)^2 + \frac{z^2}{A^2} = 0\]

Constructors

ConePosPyDy 

Fields

Instances

Instances details
Eq ConePosPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPyDy # 
Instance details

Defined in Lucan.Math.Types

data ConePosPzDz #

Cone of revolution with z-axis as central line opened in positive direction and its vertex at \( (0,0,P_z)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} - sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Constructors

ConePosPzDz 

Fields

Instances

Instances details
Eq ConePosPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPzDz # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDx #

Cone of revolution opened in positive x-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = -sign(x-P_x)\cdot(x-P_x)^2 + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConePosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDy #

Cone of revolution opened in positive y-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} -sign(y-P_y)\cdot(y-P_y)^2 + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConePosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDz #

Cone of revolution opened in positive z-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} - sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Instances

Instances details
Eq ConePosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxDx #

Cone of revolution with x-axis as central line opened in negative direction and its vertex at \( (P_x,0,0)^T \). \[ F(x,y,z) = sign(x-P_x)\cdot(x-P_x)^2 + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ConeNegPxDx 

Fields

Instances

Instances details
Eq ConeNegPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxDx # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPyDy #

Cone of revolution with y-axis as central line opened in negative direction and its vertex at \( (0,P_y,0)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + sign(y-P_y)\cdot(y-P_y)^2 + \frac{z^2}{A^2} = 0\]

Constructors

ConeNegPyDy 

Fields

Instances

Instances details
Eq ConeNegPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPyDy # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPzDz #

Cone of revolution with z-axis as central line opened in negative direction and its vertex at \( (0,0,P_z)^T \). \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} + sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Constructors

ConeNegPzDz 

Fields

Instances

Instances details
Eq ConeNegPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPzDz # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDx #

Cone of revolution opened in negative x-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = sign(x-P_x)\cdot(x-P_x)^2 + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConeNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDy #

Cone of revolution opened in negative y-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + sign(y-P_y)\cdot(y-P_y)^2 + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConeNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDz #

Cone of revolution opened in negative z-direction with its vertex at \( (P_x,P_y,P_z)^T \) \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} + sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Instances

Instances details
Eq ConeNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDx #

Torus of revolution in x-direction with its center at \( (P_x,P_y,P_z)^T \). \[ F(x,y,z) = \left( \sqrt{(y-P_y)^2 + (z-P_z)^2} - R_2 \right)^2 + (x-P_x)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDx 

Fields

Instances

Instances details
Eq TorusPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDy #

Torus of revolution in z-direction with its center at \( (P_x,P_y,P_z)^T \). \[ F(x,y,z) = \left( \sqrt{(x-P_x)^2 + (z-P_z)^2} - R_2 \right)^2 + (y-P_y)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDy 

Fields

Instances

Instances details
Eq TorusPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDz #

Torus of revolution in z-direction with its center at \( (P_x,P_y,P_z)^T \). \[ F(x,y,z) = \left( \sqrt{(x-P_x)^2 + (y-P_y)^2} - R_2 \right)^2 + (z-P_z)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDz 

Fields

Instances

Instances details
Eq TorusPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDz # 
Instance details

Defined in Lucan.Math.Types

type Box = M32 Double #

3x2 Matrix with minimum and maximum coordinates in each dimension.

data Line #

Type for a geometric ray wich has an origin and a direction. To distinguish this type from an optical ray, it is referred to as a halfline or simply a line.

Constructors

Line 

Fields

Instances

Instances details
Eq Line # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Line -> Line -> Bool #

(/=) :: Line -> Line -> Bool #

Show Line # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

data Axis #

Datatype for the orientation (direction) of an axis.

Constructors

Dx 
Dy 
Dz 

Instances

Instances details
Eq Axis # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Axis -> Axis -> Bool #

(/=) :: Axis -> Axis -> Bool #

Show Axis # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Axis -> ShowS #

show :: Axis -> String #

showList :: [Axis] -> ShowS #

data Order #

Datatype for ascending or descending order.

Constructors

Asc 
Desc 

Instances

Instances details
Eq Order # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

data AngleUnit #

Datatype for the unit of an angle which could either be radiant or degrees.

Constructors

Rad 
Deg 

Instances

Instances details
Eq AngleUnit # 
Instance details

Defined in Lucan.Math.Types

Show AngleUnit # 
Instance details

Defined in Lucan.Math.Types

Optics.Types

data System #

The Datatype System represents the whole optical system.

Constructors

System 

Fields

  • sParts :: [Part]

    All parts of the system. There should be no overlap of parts, otherwise it would abort a raytrace.

  • sSurrounding :: Material

    Medium between parts defined as a material. Usually this will be air but there are other materials possible as well.

  • sDeflect :: DeflectMethod

    Specifies the method how deflection is calculated. This is used by the raytracer.

Instances

Instances details
Eq System # 
Instance details

Defined in Lucan.Optics.Types

Methods

(==) :: System -> System -> Bool #

(/=) :: System -> System -> Bool #

Show System # 
Instance details

Defined in Lucan.Optics.Types

data Part #

A Part is a physical object with a geometric shell and a material that light can interact with.

Constructors

Part 

Fields

  • pShell :: [Surface]

    The shell is a list optical surfaces that define the outer boundary of a part. The interior of the part is the volume obtained by intersecting all of the halfspaces derived from the surfaces.

  • pMaterial :: Material

    Material of the part.

Instances

Instances details
Eq Part # 
Instance details

Defined in Lucan.Optics.Types

Methods

(==) :: Part -> Part -> Bool #

(/=) :: Part -> Part -> Bool #

Show Part # 
Instance details

Defined in Lucan.Optics.Types

Methods

showsPrec :: Int -> Part -> ShowS #

show :: Part -> String #

showList :: [Part] -> ShowS #

data Surface #

Datatype for an optical surface. It is composed as the geometric shape of the surface together with an flag that defines if the shape is inverted. A surface can also have optical properties.

Constructors

Surface 

Fields

  • sShape :: Shape

    Geometric shape of the surface that splits the space into two halfspaces. Strictly speaking spheres and tori do not create true halfspaces, but the notation is used anyway.

  • sInvert :: Bool

    An inverted surface has flipped surface normals, so inner and outer halfspaces can be interchanged.

  • sScatter :: Double

    Value between 0 and 1 that describes the scattering properties. NOTICE: The current version of Lucan does not use this value yet.

Instances

Instances details
Eq Surface # 
Instance details

Defined in Lucan.Optics.Types

Methods

(==) :: Surface -> Surface -> Bool #

(/=) :: Surface -> Surface -> Bool #

Show Surface # 
Instance details

Defined in Lucan.Optics.Types

data Material #

A Material is defined by it's physical properties that are relevant for optics.

Various ideal materials can be modelled with the following values for refractive index and internal transmittance. Please note that this is a simplification since there is also a complex refractive index, but it works for refraction based on Snell's model:

  • ideal mirrors : mRefract = Refract 0.
  • ideal absorbers : mRefract = Refract infinity ; mTransmit = Transmit 0
  • ideal transmitters : mTransmit = Transmit 1

Constructors

Material 

Fields

Instances

Instances details
Eq Material # 
Instance details

Defined in Lucan.Optics.Types

Show Material # 
Instance details

Defined in Lucan.Optics.Types

data Refract #

Datatype for different methods of how to determine the refractive index

Constructors

Refract Double

constant refractive index independent of wavelength

RefractSellmeier SellmeierCatalog String

refractive index calculated by the Sellmeier equation. Therefore a SellmeierCatalog with a valid material-key must be given

Instances

Instances details
Eq Refract # 
Instance details

Defined in Lucan.Optics.Types

Methods

(==) :: Refract -> Refract -> Bool #

(/=) :: Refract -> Refract -> Bool #

Show Refract # 
Instance details

Defined in Lucan.Optics.Types

type SellmeierCatalog = [(String, SellmeierCoefficients)] #

Catalog with named Sellmeier coefficients for different materials which is defined as a list of pairs. Each pair consists of a material name as a String and the corresponding Sellmeier coefficients. Please see the examples on how to use this.

data SellmeierCoefficients #

The Sellmeier Coefficients are used to implement dispersion, that is the refractive index is dependent of the wavelength. \[n^2(\lambda) = 1 + \frac{B_1\lambda^2}{\lambda^2-C_1} + \frac{B_2\lambda^2}{\lambda^2-C_2} + \frac{B_3\lambda^2}{\lambda^2-C_3}\]

Constructors

SellmeierCoefficients 

Fields

data Transmit #

The value for internal transmittance \( T_i \) of a material is between 0 and 1 and describes the preservation of irradiance in a unit depth \(d\) of 1cm. Info: There is a relashionship to the materials absorption coefficient \( k \) \[ T_i = \exp^{-k\cdot d} \]

Constructors

Transmit Double

fixed double value for internal transmittance

Instances

Instances details
Eq Transmit # 
Instance details

Defined in Lucan.Optics.Types

Show Transmit # 
Instance details

Defined in Lucan.Optics.Types

data DeflectMethod #

Method that determines the behaviour of raytracing

Constructors

DeflectSnell

Simplest method for deflection, where the cases for reflection and reflection were only determined by the use of Snell's law. No probabalistic method.

DeflectFresnel

In this case the fresnel equotations for unporalized light are applied to determine the deflection of a ray on a surface intersection point. A ray will be not splitted into rays with different intensities, instead the kind of deflection (refraction or reflection) is probabilistically determined based on the fresnel rules. NOTICE: This method is not implemented yet.

Instances

Instances details
Eq DeflectMethod # 
Instance details

Defined in Lucan.Optics.Types

Show DeflectMethod # 
Instance details

Defined in Lucan.Optics.Types

data Ray #

An ray is defined by its geometric properties orgin and direction together with physical properties.

Constructors

Ray 

Fields

Instances

Instances details
Eq Ray # 
Instance details

Defined in Lucan.Optics.Types

Methods

(==) :: Ray -> Ray -> Bool #

(/=) :: Ray -> Ray -> Bool #

Show Ray # 
Instance details

Defined in Lucan.Optics.Types

Methods

showsPrec :: Int -> Ray -> ShowS #

show :: Ray -> String #

showList :: [Ray] -> ShowS #

data Raytrace #

Datatype for the result after raytracing.

Constructors

Raytrace 

Fields

  • rRays :: [Ray]

    Ray segments of the raytrace in reversed order, i.e. the starting ray is at the end of the list. The endpoint of the raytrace is at the beginning of the list represented by a ray with the zero-vector as direction.

  • rLength :: Double

    Geometric length

  • rPath :: Double

    Optical path

Instances

Instances details
Eq Raytrace # 
Instance details

Defined in Lucan.Optics.Types

Show Raytrace # 
Instance details

Defined in Lucan.Optics.Types

data Intersection #

Where a ray hits a part there is an intersection. This datatype describes all the geometric and optical properties of an intersection.

Constructors

Intersection 

Fields

Instances

Instances details
Eq Intersection # 
Instance details

Defined in Lucan.Optics.Types

Show Intersection # 
Instance details

Defined in Lucan.Optics.Types

Functions

Math.Create

angularLines2d :: Double -> Int -> [Line] #

Creates a 2d-cone of lines in the xy-plane with the same origin (0,0,0) and central direction (1,0,0).

Parameters:

  • Double : aperture angle of the lines in degrees
  • Int : number of lines
  • [Line] : resulting lines

Example:

lines = angularLines2d 15 10

Available in: Free | Base | Pro

angularLines3d :: Double -> Int -> [Line] #

Creates a cone of lines in 3d with the same origin (0,0,0) and central direction (1,0,0).

Parameters:

  • Double : aperture angle of the lines in degrees
  • Int : number of lines
  • [Line] : resulting lines

Example:

lines = angularLines3d 15 200

Available in: Free | Base | Pro

parallelLines2d :: Double -> Int -> [Line] #

Creates a list of parallel lines in yz-plane in positve x-direction. The origin of the beam center is in (0,0,0).

Parameters:

  • Double : lines width
  • Int : number of lines
  • [Line] : resulting lines

Available in: Free | Base | Pro

parallelLines3d :: Double -> Int -> [Line] #

Creates a list of parallel lines with circular profile in positive x-direction. The orgin of the beam center is in (0,0,0).

Parameters:

  • Double : lines width (diameter)
  • Int : number of lines
  • [Line] : resulting lines

Available in: Free | Base | Pro

Math.Transform

moveLine :: V3 Double -> V3 Double -> Line -> Line #

6-Parameter Transformation of a Line. This function can be used to move a newly created line to some arbitrary orientation and position.

Parameters:

  • V3 Double : euler angles (alpha, beta, gamma) in degrees of the rotation matrix for the new orientation. The order of rotation is:

    1. Rotate around z-Axis with angle alpha
    2. Rotate around x-Axis with angle beta
    3. Rotate around z-Axis with angle gamma
  • V3 Double : translation vector (tx, ty, tz) to the new position
  • Line : line to transform
  • Line : resulting line

Available in: Free | Base | Pro

moveLines :: V3 Double -> V3 Double -> [Line] -> [Line] #

6-Parameter Transformation of multiple Lines. The transformation parameters are the same as in moveLine.

Available in: Free | Base | Pro

Math.Util

infinity :: Double #

Infinity is larger than any real number. Here it is defined as 1/0.

Available in: Free | Base | Pro

epsilon :: Double #

Epsilon is the approximation to machine epsilon, which is at 2.220446049250313e-16 for double precision (64-bit). This value can be used in direct or derived form (depending on the context) for algorithms that require a small positive tolerance.

Available in: Free | Base | Pro

getBoxDiameter :: Box -> Double #

Calculates the diameter of a box.

Available in: Free | Base | Pro

Optics.Raytrace

traceRay :: System -> Ray -> Raytrace #

This Function is for trace a single ray through a system. The raytrace ends when the source ray or any deflected ray of the trace has no more next intersection. This also means if a ray does not hit any surface, it won't be added to the raytrace and therefore is not visualized. To visualize all possible rays, you can add a part which is a bounding box around all the other parts of the system. This way there is an intersection where an escaping ray hits the bounding box and it will be visualized. The bounding box should be of the same material as the surrounding to ensure that there is no deflection.

Available in: Free | Base | Pro

traceRays :: System -> [Ray] -> [Raytrace] #

Raytracing of multiple rays through a system. The same rules as are described in traceRay apply to each single ray.

Available in: Free | Base | Pro

Optics.Util

getPartsForPoint :: System -> V3 Double -> [Part] #

Returns the list of parts where a point lies inside.

Available in: Base | Pro

isInsidePart :: Part -> V3 Double -> Bool #

Tests if a point lies inside an part.

Parameters:

  • Part : part
  • V3 Double : point
  • Bool : boolean return value

Available in: Base | Pro

toRays :: Double -> Material -> [Line] -> [Ray] #

Converts lines in a bulk to rays by assigning them all the same optical properties. Be careful with this function, since all line origins should lie within parts of the same material that is assigned.

Parameters:

  • Double : wavelength of the rays light in vacuum in micrometers
  • Material : assigned material where the orgins lie in
  • [Line] : list of halflines
  • [Ray] : list of resulting rays

Available in: Free | Base | Pro

UI.Export

exportParts :: FilePath -> Double -> Box -> [Part] -> IO () #

Exports parts in various formats for import into external CAD programs. The file format is identified by the extension in the filepath. The following formats are supported:

  • XYZ (extension .xyz): Sampled 3d points on the part shells are saved in a text file. Each line consists of the coordinates of one point separated by a whitespace. There is no separation between different parts in the exported file.
  • STEP (extension .stp or .step): Parts are exported in their boundary representation. The part surfaces are stored in analytical form and the edges at surface intersections are stored as precisely calculated spline curves. A resolution around 0.001 times the bounding box diameter usually works fine. It can be decreased for parts with closely adjacent vertices or edges, but there are limitations due to longer computation times. You can also use a tighter bounding box on particular parts and export them separately. Please note that some CAD softwares can have problems with the STEP import. It was observed that sometimes the wrong side of a surface is clipped or revolved surfaces such as paraboloids are missing. There are two testfiles 'TestParts.stp' and 'FirstLens.stp' in the examples folder to test the import capabilities of other programs.

Parameters:

  • FilePath : output filepath, a relative path is possible
  • Double : resolution of a point sampling on the parts shells
  • Box : bounding box that encloses the parts
  • [Part] : parts to export
  • IO () : returned IO action

Available in: Base | Pro

UI.View

initView :: String -> V2 Int -> V2 Int -> Box -> IO View #

Before visualizing any graphical content a view object must be initialized with initView. It's possible to create multiple view instances. The view coordinate system is such that the coordinate origin (0,0,0) lies in the center of the screen and the x-axis points to the right and the y-axis to the top. The z-axis points upward from the screen into the users eye. Call this function within an IO block.

Parameters:

  • String : window title
  • V2 Int : window size
  • V2 Int : window position
  • Box : bounding box of the volume to render
  • IO View : returned IO action with the view

Example:

view <- initView "myTitle" (800,600) (100,100) ((20,20),(20,20),(20,20))

Available in: Free | Base | Pro

runView :: View -> IO () #

Shows a view and runs its renderloop. Call this function within an IO block. During the renderloop the following user interactions could be triggerd with mouse and keyboard events:

  • pan: Press the right mouse button and move the cursor
  • zoom: Press the right mouse button and scroll mouse-wheel
  • xy-Rotation: Press left mouse button and move the cursor
  • z-Rotation: Move the mouse cursor to the center of rotation, press the left and right mouse button, move the cursor away from the center and then sideways
  • redraw: Some graphic content, such as the parts, is rendered as a pointcloud. This pointcloud can be recalculated and redrawed for different sights after a navigation. You can trigger a redraw with the Space key
  • close: Close the view window with the Esc key

Available in: Free | Base | Pro

runViews :: [View] -> IO () #

Shows multiple views and runs their mainloops. User interactions are accepted for each of them. Call this function within an IO block.

Available in: Free | Base | Pro

viewParts :: View -> [Part] -> IO () #

Adds parts to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewPoint :: View -> V3 Double -> IO () #

Adds a single point to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewPoints :: View -> [V3 Double] -> IO () #

Adds multiple points to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewLine :: View -> Line -> IO () #

Adds a single line to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewLines :: View -> [Line] -> IO () #

Adds multiple lines to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewRay :: View -> Ray -> IO () #

Adds a single ray to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewRays :: View -> [Ray] -> IO () #

Adds multiple rays to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewRaytrace :: View -> Raytrace -> IO () #

Adds a single raytrace to a view. Call this function within an IO block.

Available in: Free | Base | Pro

viewRaytraces :: View -> [Raytrace] -> IO () #

Adds multiple raytraces to a view. Call this function within an IO block.

Available in: Free | Base | Pro