Revision: 54434
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54434&view=rev
Author:   carlmoore
Date:     2013-02-19 21:39:37 +0000 (Tue, 19 Feb 2013)
Log Message:
-----------
use DEG2RAD to simplify expressions; is the 'global' OK?

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/vmath.tcl

Modified: brlcad/trunk/src/tclscripts/vmath.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/vmath.tcl       2013-02-19 17:52:49 UTC (rev 
54433)
+++ brlcad/trunk/src/tclscripts/vmath.tcl       2013-02-19 21:39:37 UTC (rev 
54434)
@@ -38,6 +38,7 @@
 set M_2_SQRTPI 1.12837916709551257389615890312
 set M_SQRT2    1.41421356237309504880168872421
 set M_SQRT1_2  0.70710678118654752440084436210
+set DEG2RAD    0.017453292519943295769236907684
 
 proc init_vmath {} {
     # this routine does nothing except ensure that the above global variables 
get set
@@ -486,13 +487,13 @@
 }
 
 proc quat_from_rot_deg {r x y z} {
-    global M_PI
-    return [quat_from_vrot [expr $r * ( $M_PI / 180.0 )] [list $x $y $z]]
+    global DEG2RAD
+    return [quat_from_vrot [expr $r * $DEG2RAD ] [list $x $y $z]]
 }
 
 proc quat_from_vrot_deg {r v} {
-    global M_PI
-    return [quat_from_vrot [expr $r * ($M_PI / 180.0) ] $v]
+    global DEG2RAD
+    return [quat_from_vrot [expr $r *$DEG2RAD ] $v]
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to