Skip to content

Commit caf3cf0

Browse files
committed
rm old utility functions
1 parent 09f926a commit caf3cf0

File tree

2 files changed

+3
-217
lines changed

2 files changed

+3
-217
lines changed

examples/fourbar.jl

Lines changed: 0 additions & 152 deletions
This file was deleted.

src/orientation.jl

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -305,78 +305,16 @@ Returns a `RotationMatrix` object.
305305
"""
306306
function axis_rotation(sequence, angle; name = :R)
307307
if sequence == 1
308-
return RotationMatrix(rotx(angle), zeros(3))
308+
return RotationMatrix(Rotations.RotX(angle), zeros(3))
309309
elseif sequence == 2
310-
return RotationMatrix(roty(angle), zeros(3))
310+
return RotationMatrix(Rotations.RotY(angle), zeros(3))
311311
elseif sequence == 3
312-
return RotationMatrix(rotz(angle), zeros(3))
312+
return RotationMatrix(Rotations.RotZ(angle), zeros(3))
313313
else
314314
error("Invalid sequence $sequence")
315315
end
316316
end
317317

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
380318

381319
function from_nxy(n_x, n_y)
382320
e_x = norm(n_x) < 1e-10 ? [1.0, 0, 0] : _normalize(n_x)

0 commit comments

Comments
 (0)