rayoptics.util.misc_math module
miscellaneous functions for working with numpy vectors and floats
- perpendicular_distance_2d(pt, pt1, pt2)[source]
return perpendicular distance of pt from the line between pt1 and pt2
- perpendicular_to_radial(pt, pt2)[source]
return perpendicular distance of pt from the line between the origin and pt2
- perpendicular_to_line(pt, pt1, pt2)[source]
return perpendicular distance of pt from the line between pt1 and pt2
- perpendicular_from_origin(pt1, pt2)[source]
return perpendicular distance of the origin from the line between pt1 and pt2
- euler2opt(e)[source]
convert right-handed euler angles to optical design convention, i.e. alpha and beta are left-handed
- circle_intersection_area(ra, rb, d)[source]
return the area of the intersection of 2 circles
- Parameters:
ra – radius of first circle
rb – radius of second circle
d – separation of the circles’ centers of curvature
- Returns:
area of the circle intersection
Weisstein, Eric W. “Circle-Circle Intersection.” From MathWorld–A Wolfram Web Resource.
- compute_tangent_point_to_circle(CofC, r, pt)[source]
return the area of the intersection of 2 circles
- Parameters:
CofC – center of curvature of circle (2d numpy array)
r – radius of circle
pt – 2d numpy array of point outside of circle
- Returns:
the 2 tangent points for lines from pt to circle
gboffi. “How to find the equation of a line, tangent to a circle, that passes through a given external point.” StackExchange (version: 2019-05-30)