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:
authorCampbell Barton <ideasman42@gmail.com>2010-04-17 12:55:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-17 12:55:31 +0400
commit3afd8d6cc859255d0b52081fbee91b6c6a012b4c (patch)
tree262281013dbad763f94e4f3cd83d414aa24dd0bf /source/blender/blenlib/intern/math_rotation.c
parentc00e7fb89dc6f44b74036256e55e00e9287b67db (diff)
move camera lens/angle conversion to BLI_math
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r--source/blender/blenlib/intern/math_rotation.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 4af0a3a4248..a8212a531a6 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1503,3 +1503,13 @@ void copy_dq_dq(DualQuat *dq1, DualQuat *dq2)
memcpy(dq1, dq2, sizeof(DualQuat));
}
+/* lense/angle conversion (radians) */
+float lens_to_angle(float lens)
+{
+ return 2.0f * atan(16.0f/lens);
+}
+
+float angle_to_lens(float angle)
+{
+ return 16.0f / tan(angle * 0.5f);
+}