Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r--source/blender/blenlib/intern/math_rotation.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 0ca8b72c1e3..7fecbae8229 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1688,14 +1688,14 @@ void vec_apply_track(float vec[3], short axis)
}
/* lens/angle conversion (radians) */
-float lens_to_angle(float lens)
+float focallength_to_fov(float focal_length, float sensor)
{
- return 2.0f * atanf(16.0f/lens);
+ return 2.0f * atanf((sensor/2.0f) / focal_length);
}
-float angle_to_lens(float angle)
+float fov_to_focallength(float hfov, float sensor)
{
- return 16.0f / tanf(angle * 0.5f);
+ return (sensor/2.0f) / tanf(hfov * 0.5f);
}
/* 'mod_inline(-3,4)= 1', 'fmod(-3,4)= -3' */