Trigonometry¶
Provide functions for the trigonometric functions.
-
pyrr.trig.
aspect_ratio
(width, height)¶
-
pyrr.trig.
calculate_fov
(zoom, height=1.0)¶ Calculates the required FOV to set the view frustrum to have a view with the specified height at the specified distance.
Parameters: Return type: A float representing the FOV to use in degrees.
-
pyrr.trig.
calculate_height
(fov, zoom)¶ Performs the opposite of calculate_fov. Used to find the current height at a specific distance.
Parameters: Return type: A float representing the height at the specified distance for the specified FOV.
-
pyrr.trig.
calculate_plane_size
(aspect_ratio, fov, distance)¶ Calculates the width and height of a plane at the specified distance using the FOV of the frustrum and aspect ratio of the viewport.
Parameters: Return type: A tuple of two floats: width and height: The width and height of the plane.
-
pyrr.trig.
calculate_zoom
(fov, height=1.0)¶ Calculates the zoom (distance) from the camera with the specified FOV and height of image.
Parameters: Return type: A float representing the zoom (distance) from the camera for the desired height at the specified FOV.
Raises: ZeroDivisionError – Raised if the fov is 0.0.