(axis, angle)
| 58 | return math.sqrt(vec3[0]*vec3[0] + vec3[1]*vec3[1] + vec3[2]*vec3[2]) |
| 59 | |
| 60 | def rotation(axis, angle): |
| 61 | rot = np.eye(4) |
| 62 | c = np.cos(-angle) |
| 63 | s = np.sin(-angle) |
| 64 | t = 1.0 - c |
| 65 | axis /= compute_length_vec3(axis) |
| 66 | x = axis[0] |
| 67 | y = axis[1] |
| 68 | z = axis[2] |
| 69 | rot[0,0] = 1 + t*(x*x-1) |
| 70 | rot[0,1] = z*s+t*x*y |
| 71 | rot[0,2] = -y*s+t*x*z |
| 72 | rot[1,0] = -z*s+t*x*y |
| 73 | rot[1,1] = 1+t*(y*y-1) |
| 74 | rot[1,2] = x*s+t*y*z |
| 75 | rot[2,0] = y*s+t*x*z |
| 76 | rot[2,1] = -x*s+t*y*z |
| 77 | rot[2,2] = 1+t*(z*z-1) |
| 78 | return rot |
| 79 | |
| 80 | |
| 81 | verts = [] |
no test coverage detected