@@ -305,78 +305,16 @@ Returns a `RotationMatrix` object.
305
305
"""
306
306
function axis_rotation (sequence, angle; name = :R )
307
307
if sequence == 1
308
- return RotationMatrix (rotx (angle), zeros (3 ))
308
+ return RotationMatrix (Rotations . RotX (angle), zeros (3 ))
309
309
elseif sequence == 2
310
- return RotationMatrix (roty (angle), zeros (3 ))
310
+ return RotationMatrix (Rotations . RotY (angle), zeros (3 ))
311
311
elseif sequence == 3
312
- return RotationMatrix (rotz (angle), zeros (3 ))
312
+ return RotationMatrix (Rotations . RotZ (angle), zeros (3 ))
313
313
else
314
314
error (" Invalid sequence $sequence " )
315
315
end
316
316
end
317
317
318
- """
319
- rotx(t, deg = false)
320
-
321
- Generate a rotation matrix for a rotation around the x-axis.
322
-
323
- - `t`: The angle of rotation (in radians, unless `deg` is set to true)
324
- - `deg`: (Optional) If true, the angle is in degrees
325
-
326
- Returns a 3x3 rotation matrix.
327
- """
328
- function rotx (t, deg = false )
329
- if deg
330
- t *= pi / 180
331
- end
332
- ct = cos (t)
333
- st = sin (t)
334
- R = [1 0 0
335
- 0 ct - st
336
- 0 st ct]
337
- end
338
-
339
- """
340
- roty(t, deg = false)
341
-
342
- Generate a rotation matrix for a rotation around the y-axis.
343
-
344
- - `t`: The angle of rotation (in radians, unless `deg` is set to true)
345
- - `deg`: (Optional) If true, the angle is in degrees
346
-
347
- Returns a 3x3 rotation matrix.
348
- """
349
- function roty (t, deg = false )
350
- if deg
351
- t *= pi / 180
352
- end
353
- ct = cos (t)
354
- st = sin (t)
355
- R = [ct 0 st
356
- 0 1 0
357
- - st 0 ct]
358
- end
359
-
360
- """
361
- rotz(t, deg = false)
362
-
363
- Generate a rotation matrix for a rotation around the z-axis.
364
-
365
- - `t`: The angle of rotation (in radians, unless `deg` is set to true)
366
- - `deg`: (Optional) If true, the angle is in degrees
367
-
368
- Returns a 3x3 rotation matrix.
369
- """
370
- function rotz (t, deg = false )
371
- if deg
372
- t *= pi / 180
373
- end
374
- ct = cos (t)
375
- st = sin (t)
376
- R = [ct - st 0
377
- st ct 0
378
- 0 0 1 ]
379
- end
380
318
381
319
function from_nxy (n_x, n_y)
382
320
e_x = norm (n_x) < 1e-10 ? [1.0 , 0 , 0 ] : _normalize (n_x)
0 commit comments