MAT_MUL(nged)
multiply two 4x4 matrices
๐ mat_mul โ the manual page, but make it make sense
okay so this is mat_mul, a command from the nged manual (BRL-CAD User Commands, bestie โ that's the crew we're running with) โจ
โจ NAME โจ
mat_mul โ multiply two 4x4 matrices ๐งฎ
๐ SYNOPSIS ๐
mat_mul matA matB
๐ DESCRIPTION ๐
So the mat_mul command multiplies two 4x4 homogeneous transformation matrices together, and it computes:
result = matA * matB
Both matA and matB must be given as 16-element space-separated floating-point strings โ literally the format that bn_encode_mat produces. And the result? Comes back in that exact same 16-element encoded format. no cap, same vibe in, same vibe out ๐ซถ
The operation itself is the standard 4x4 matrix product. Lowkey important: this command is the GED wrapper for bn_mat_mul, so it's out here fronting for the real one.
โ ๏ธ Careful bestie โ matrix multiplication is not commutative. The order of operands matters. Flip them and you get a different answer, fr fr. ๐
๐ธ EXAMPLES ๐ธ
Example 1. Multiply two identity matrices ๐
mged> mat_mul "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1" "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"
Returns the identity matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1, because the product of two identity matrices is the identity. iconic behaviour honestly โจ
Example 2. Chain two rotation matrices ๐
mged> set m1 [mat_ae 45 0]
mged> set m2 [mat_ae 0 30]
mged> mat_mul $m1 $m2
This composes the azimuth rotation matrix $m1 with the elevation rotation matrix $m2, and returns their combined transformation. it's giving collaboration ๐
๐ฆ AUTHOR ๐ฆ
BRL-CAD Team ๐
๐ BUG REPORTS ๐
If you find a bug or a problem, pls submit it via electronic mail to devs@brlcad.org โ they genuinely want to hear from you, bestie ๐
and that's the whole page!! brought to you by BRL-CAD, filed under MAT_MUL(nged) โ go forth and multiply (matrices) ๐ฅ๐๐
๐ฆ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms