Contains
This function calculates transmitted vector after refraction at planar surface. \(medium1\) and \(medium2\) can be \(Medium\) or any sympifiable object.
If \(incident\) is an object of \(Ray3D\), \(normal\) also has to be an instance of \(Ray3D\) in order to get the output as a \(Ray3D\). Please note that if plane of separation is not provided and normal is an instance of \(Ray3D\), normal will be assumed to be intersecting incident ray at the plane of separation. This will not be the case when \(normal\) is a \(Matrix\) or any other sequence. If \(incident\) is an instance of \(Ray3D\) and \(plane\) has not been provided and \(normal\) is not \(Ray3D\), output will be a \(Matrix\).
Parameters : | incident : Matrix, Ray3D, or sequence
medium1 : sympy.physics.optics.medium.Medium or sympifiable
medium2 : sympy.physics.optics.medium.Medium or sympifiable
normal : Matrix, Ray3D, or sequence
plane : Plane
|
---|
Examples
>>> from sympy.physics.optics import refraction_angle
>>> from sympy.geometry import Point3D, Ray3D, Plane
>>> from sympy.matrices import Matrix
>>> from sympy import symbols
>>> n = Matrix([0, 0, 1])
>>> P = Plane(Point3D(0, 0, 0), normal_vector=[0, 0, 1])
>>> r1 = Ray3D(Point3D(-1, -1, 1), Point3D(0, 0, 0))
>>> refraction_angle(r1, 1, 1, n)
Matrix([
[ 1],
[ 1],
[-1]])
>>> refraction_angle(r1, 1, 1, plane=P)
Ray3D(Point3D(0, 0, 0), Point3D(1, 1, -1))
With different index of refraction of the two media
>>> n1, n2 = symbols('n1, n2')
>>> refraction_angle(r1, n1, n2, n)
Matrix([
[ n1/n2],
[ n1/n2],
[-sqrt(3)*sqrt(-2*n1**2/(3*n2**2) + 1)]])
>>> refraction_angle(r1, n1, n2, plane=P)
Ray3D(Point3D(0, 0, 0), Point3D(n1/n2, n1/n2, -sqrt(3)*sqrt(-2*n1**2/(3*n2**2) + 1)))
This function calculates the angle of deviation of a ray due to refraction at planar surface.
Parameters : | incident : Matrix, Ray3D, or sequence
medium1 : sympy.physics.optics.medium.Medium or sympifiable
medium2 : sympy.physics.optics.medium.Medium or sympifiable
normal : Matrix, Ray3D, or sequence
plane : Plane
|
---|
Examples
>>> from sympy.physics.optics import deviation
>>> from sympy.geometry import Point3D, Ray3D, Plane
>>> from sympy.matrices import Matrix
>>> from sympy import symbols
>>> n1, n2 = symbols('n1, n2')
>>> n = Matrix([0, 0, 1])
>>> P = Plane(Point3D(0, 0, 0), normal_vector=[0, 0, 1])
>>> r1 = Ray3D(Point3D(-1, -1, 1), Point3D(0, 0, 0))
>>> deviation(r1, 1, 1, n)
0
>>> deviation(r1, n1, n2, plane=P)
-acos(-sqrt(-2*n1**2/(3*n2**2) + 1)) + acos(-sqrt(3)/3)
This function calculates focal length of a thin lens. It follows cartesian sign convention.
Parameters : | n_lens : Medium or sympifiable
n_surr : Medium or sympifiable
r1 : sympifiable
r2 : sympifiable
|
---|
Examples
>>> from sympy.physics.optics import lens_makers_formula
>>> lens_makers_formula(1.33, 1, 10, -10)
15.1515151515151
This function provides one of the three parameters when two of them are supplied. This is valid only for paraxial rays.
Parameters : | focal_length : sympifiable
u : sympifiable
v : sympifiable
|
---|
Examples
>>> from sympy.physics.optics import mirror_formula
>>> from sympy.abc import f, u, v
>>> mirror_formula(focal_length=f, u=u)
f*u/(-f + u)
>>> mirror_formula(focal_length=f, v=v)
f*v/(-f + v)
>>> mirror_formula(u=u, v=v)
u*v/(u + v)
This function provides one of the three parameters when two of them are supplied. This is valid only for paraxial rays.
Parameters : | focal_length : sympifiable
u : sympifiable
v : sympifiable
|
---|
Examples
>>> from sympy.physics.optics import lens_formula
>>> from sympy.abc import f, u, v
>>> lens_formula(focal_length=f, u=u)
f*u/(f + u)
>>> lens_formula(focal_length=f, v=v)
f*v/(f - v)
>>> lens_formula(u=u, v=v)
u*v/(u - v)
Parameters : | f: sympifiable Focal length of a given lens N: sympifiable F-number of a given lens c: sympifiable Circle of Confusion (CoC) of a given image format |
---|
Example
>>> from sympy.physics.optics import hyperfocal_distance
>>> from sympy.abc import f, N, c
>>> round(hyperfocal_distance(f = 0.5, N = 8, c = 0.0033), 2)
9.47