C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,416 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need this code which is in Javascript
:m1:float[,] m2:float[,]`function multiplyMatrices(m1, m2) {
return m1.map((row, i) => {
return m2[0].map((_, j) =>
row.reduce((acc, _, n) =>
acc + m1[i][n] * m2[n][j], 0
)
)
});
}`
```and code: `for (const mRotate of [mRotateX, mRotateY, mRotateZ]) {
const mVertex = Object.values(vertex).map(_ => [_]);
const [x, y, z] = multiplyMatrices(mRotate, mVertex).map(e => e.pop());
vertex.x = x;
vertex.y = y;
vertex.z = z;
}` for parameter mRotateX and mRotateY and mRotateZ is `float[,] rotate_x =
{
{1,0,0 },
{0,(float)Math.Cos(angle_x), -(float)Math.Sin(angle_x)},
{0,(float)Math.Sin(angle_x),(float)Math.Cos(angle_x) }
};`