Rodrigues’ rotation formula: Difference between revisions
m
→{{header|Raku}}: more cosmetic twiddles
Thundergnat (talk | contribs) m (→{{header|Raku}}: rearrange terms to be more symmetrical (strictly cosmetic)) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: more cosmetic twiddles) |
||
Line 635:
}
▲put qq:to/END/;
{
▲ Perhaps more useful, (when calculating a range of motion for a robot appendage,
▲ for example), feeding a point, axis of rotation and rotation angle separately;
▲ since theoretically, the point vector and axis of rotation should be constant:
▲for 0, 10, 20 ... 180 { # in degrees
▲ printf "Rotated %3d°: %.13f, %.13f, %.13f\n", $_,
rodrigues-rotate [5, -6, 4], ([5, -6, 4] ❌ [8, 5, -30]).&normal, .°
}).join: "\n"
}</lang>▼
}
{{out}}
<pre>Task example - Point and composite axis / angle:
|