Create an array with a scaling matrix. Parameters ---------- x, y, z : scalar Scaling factors. Returns ------- s : array, shape = (4, 4) The scaling matrix.
(x=1, y=1, z=1)
| 407 | |
| 408 | |
| 409 | def scaling(x=1, y=1, z=1): |
| 410 | """Create an array with a scaling matrix. |
| 411 | |
| 412 | Parameters |
| 413 | ---------- |
| 414 | x, y, z : scalar |
| 415 | Scaling factors. |
| 416 | |
| 417 | Returns |
| 418 | ------- |
| 419 | s : array, shape = (4, 4) |
| 420 | The scaling matrix. |
| 421 | """ |
| 422 | s = np.array([[x, 0, 0, 0], [0, y, 0, 0], [0, 0, z, 0], [0, 0, 0, 1]], dtype=float) |
| 423 | return s |
| 424 | |
| 425 | |
| 426 | def translation(x=0, y=0, z=0): |
no outgoing calls