Trigonometry¶
Provide functions for the trigonometric functions.
-
pyrr.trig.
calculate_fov
(zoom, height=1.0)[source]¶ Calculates the required FOV to set the view frustrum to have a view with the specified height at the specified distance.
Parameters: Return type: Returns: The FOV to use in degrees.
-
pyrr.trig.
calculate_height
(fov, zoom)[source]¶ Performs the opposite of calculate_fov. Used to find the current height at a specific distance.
Parameters: Return type: Returns: The height at the specified distance for the specified FOV.
-
pyrr.trig.
calculate_plane_size
(aspect_ratio, fov, distance)[source]¶ 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: Returns: The width and height of the plane.
-
pyrr.trig.
calculate_zoom
(fov, height=1.0)[source]¶ Calculates the zoom (distance) from the camera with the specified FOV and height of image.
Parameters: Return type: Returns: The zoom (distance) from the camera for the desired height at the specified FOV.
Raises: ZeroDivisionError – Raised if the fov is 0.0.