Commits

Takafumi Arakaki committed 2915143

@tkf がためしに書き換えてみた ver

Comments (0)

Files changed (1)

-#!/usr/bin/env 
-# coding by shunyo ogawa
-# updated in 1 Nov. 2011
+#!/usr/bin/env python
 
 
-# type: kick board; bike 
-# radius: wheel radius
-# num: number
-def gear(type,num,radius):
-    
-    if type = "kick":
-        w_wheel = (160. + (radius -4 ) * 40. )* num
+def gear(type, num, radius):
+    """
+    THIS FUNCTION DOES ....
+
+    Parameters
+    ----------
+    type : {'kick', 'bike'}
+      'kick': kick board; 'bike': bike.
+    num: number
+       NUMBER OF WHAT?
+    radius : number
+      wheel radius
+
+    """
+
+    if type == "kick":
+        w_wheel = (160. + (radius - 4) * 40.) * num
         w_col = 300. * 2.
-    elif type = "bike":
-        w_wheel = (1000. + (radius -26 ) * 200. )* num
+    elif type == "bike":
+        w_wheel = (1000. + (radius - 26) * 200.) * num
         w_col = 1000.
-    
-    
-    return w_wheel+w_col
 
+    return w_wheel + w_col
 
-    
+
 if __name__ == "__main__":
-    num1 = 2 
+    num1 = 2
     radius1 = 4.
-    type1 = "kick" 
-    w_gear = gear(type1,num1,radius1)
+    type1 = "kick"
+    w_gear = gear(type1, num1, radius1)